Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
for high-level questions about the choices made during contract construction
0
votes
1
answer
191
views
Can we have an array of Ether in Solidity?
My ultimate goal is to have an array of token, e.g.
mapping (address => x) token_balance;
where x is of type a float/double.
As far as I'm aware, Solidity does not support float/double values.
…
1
vote
1
answer
177
views
Storing state in log vs in contract variable
I've read somewhere says storing values in logs is cheaper than storing it in the contract's permanent storage. I wondered if it is the case. If yes, why?
More general question: What is the pros and …
2
votes
2
answers
58
views
Is it right to say: A contract account may contain more than one contract?
My question is related to my previous question:
Solidity: How can a contract B, burn from contract A, generate another contract?
As we can in the aforementioned post when we are deploying contract …
1
vote
1
answer
209
views
Why does adding more external functions adds more cost to a smart contract?
Please let me know to delete the question if it's already been asked.
I was told (by a colleague of mine) that adding more external function to a smart contract increases its gas. I tested (on rem …
30
votes
6
answers
32k
views
Solidity: How can we write a error message in "require"?
Im learning Solidity. As far as I'm aware, it's recommended using "require" to handle errors. But, I'd like to inform the users about the kind of errors they make, e.g. an argument is invalid or out o …
8
votes
2
answers
7k
views
Solidity: How to get "floor" of a floating value?
I'm aware that Solidity doesn't support double and floating values.
I'd like to know if there's any way, in Solidity, to get the floor of a division, like: floor(x/2), where x can be any arbitrary "u …
3
votes
1
answer
163
views
Can a Smart contract post an advert on facebook, twitter, etc?
Assume we have a variable in a smart contract. When it reaches a certain value (as a result of interacting with), it posts an advert on social media, like Facebook, and pays for it.
Question: Is it …
2
votes
0
answers
530
views
Do we have to have a fallback function in our smart contract?
I have a smart contract that has only one payable function and one that pays, as follows:
contract DAO_Test{
// define something
function buyToken() payable external returns(bool){
uin …
0
votes
1
answer
46
views
Additional parameters in function
As we know, in every function call we can add {from: "address, value:5, gass: 420000}. I wondered who provides these capabilities? Is it Solidity, VM or web3.
1
vote
1
answer
49
views
How can an old deployed contract can call a newly deployed contract?
As we know, in order for a contract to call the other contract, it needs to know the called contract interface/abstract.
Question 1: Can we pass that interface/abstract as a function argument to a c …
0
votes
2
answers
631
views
How to deploy a contract and its abstract/interface?
Assume I have a contract A:
pragma solidity ^0.4.4;
contract A{
struct St{
uint val;
}
function double(uint a)external returns (uint res){
res= 2*a;
}
}
Let's call the above lines of …
3
votes
2
answers
2k
views
Is "transfer" a transaction or a call/message?
I wondered if "transfer()" function is a call or a transaction.
We know contracts only send messages, not transactions.
If a DAO-like contract has a variable and a threshold when the variable reac …
2
votes
2
answers
11k
views
How to properly convert wei to Ether in a contact?
As we know msg.value in contract is in wei. I wondered if there is a better way to convert it to Ether than dividing it by 10^18?
As an application consider the case where people buy tokens and the c …
17
votes
1
answer
19k
views
Solidity: private vs public variables
In a smart contract, if we make a member variable public:
Question 1: Can a malicious party write a transaction/contract and change the value/state of the public variable in the contract?
Question 2: …
1
vote
1
answer
142
views
In a HTML user interface how can we alert user when it inserts incorrect password/address?
I'm trying to design a user interface for private blockchain using Ethereum to test my contracts. So, users with different password and account address login.
I'm aware of this question, but it was …