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 |
Solidity is a contract-oriented, high-level language whose syntax is similar to that of JavaScript and it is designed for writing smart contracts in Ethereum to run on the EVM. Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features.
1
vote
Delete mapping values in solidity?
i need to make whole mapping -> uints values set to 0
If you're talking about immediately after creation, they already are.
https://docs.soliditylang.org/en/v0.8.0/types.html?highlight=types#mapping …
1
vote
Parameters for deploying ballet smart contract using ethereum wallet
If you're just starting off, you might find using Browser Solidity easier. …
4
votes
Accepted
setting the length property of array
What does setting the length property of an array do.
It sets the length of the array.
The proviso is that the array must be dynamic, and must be a storage rather than memory variable.
From the …
2
votes
Accepted
Why was it necessary to develop Solidity?
With regards to the rest of your question, this should cover it: How was Solidity conceived and what design tradeoffs were made when building it?
Why invent the EVM? …
1
vote
Why do we need to specify constant in the return value
Why do we need to specify constant in the return value
Just to be pedantic: the return value isn't being declared as constant, the function is, as the document snippet in the other answer has poi …
1
vote
Accepted
Web3: constant get function - error: is not a function
getCardByID is not a function, but getCardById is.
Note the lower-case d in the function definition of the contract.
1
vote
Solidity compile Error: Expected primary expression help
A few things:
There's no closing brace on your contract.
There's a space in the line adopters [pedId].
There's a typo in the same line. pedId -> petId.
The actual issue you've reported is due to = …
5
votes
Accepted
What is the "^=" operator?
This is perhaps more of a general programming question than anything specific to Solidity...
It's a bitwise exclusive OR (XOR - ^), combined with an assignment operator (=). …
2
votes
Why did this txn not transfer balance, I passed the exact same string same hex as response s...
For people to follow along...
I called contract's Try function by passing the same string which was passed in Start function.
The Start function was called in this transaction, and passed the follow …
1
vote
What is .div() method in solidity?
what does .div() do here?
Divide.
The contract you're looking at uses SafeMath.sol to protect against integer overflows.
0
votes
Creating an ERC20 faucet
what line number do I put in the address of my ERC20 token?
For the contract you've pointed to, you don't explicitly add the token address to the faucet contract code. (You could but you'd have to c …
11
votes
Convert wei to ether in contract
The base unit for currency in Solidity is Wei. That means if you're dealing with balances, and you don't specify a unit, then it defaults to Wei. …
1
vote
Split a string into two at places where ? occurs
The var keyword was deprecated in Solidity 0.4.20 (see release notes).
This previous answer should help with what you want to do: How can I slice bytes, strings, and arrays in Solidity? …
19
votes
Meaning of 'using SafeMath for uint256;'
using ... for ... is explained in Solidity's documentation, here, and is a way to attach library functions to a given type.
So in your case:
using SafeMath for uint256;
...means that the functions …
7
votes
Accepted
Logarithm math operation in Solidity
Though there's no current implementation (and I couldn't see one in the dapp-bin either), you could implement your own using a Taylor Series, as suggested by Vitalik in this old Reddit thread.
For th …