Skip to main content
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
Results tagged with
Search options not deleted user 4181

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

Deploying a contract multiple times with the same Library

the answer to this can be found in solidity's docs: Libraries are similar to contracts, but their purpose is that they are deployed only once at a specific address and their code is reused using …
n1cK's user avatar
  • 3,408
1 vote

Is `require` in solidity identical to `assert`?

It's basically a short form. The idea likely originates from "requiring things to be there", which checks for a boolean condition, but also can check things the assert way.
n1cK's user avatar
  • 3,408
1 vote

Few questions about the overflow

but msg is composed by Ethereum network, and it should correspond to a real amount transfered, correct? That is right. There is no tampering with msg. value. However, you could of course do 1 - m …
n1cK's user avatar
  • 3,408
5 votes

how do I loop through a mapping of address to struct

assert(reserved_names[username] == 0x0);
n1cK's user avatar
  • 3,408
3 votes
Accepted

Can I implement 'function balance()' in a contract?

address(this).balance Here, balance is a member function of the address type. The function above is a function of your contract. Nothing to fear.
n1cK's user avatar
  • 3,408
1 vote

Returning array of bytes32 in solidity

In case you need this data returned off-chain (not in a contract to contract call) you could simply iterate through the entries of a public array.
n1cK's user avatar
  • 3,408
0 votes

TypeError: Type contract testAdoption is not implicitly convertible to expected type address

Implicit address conversion for this was deprecated in solidity 0.5.0ish. You need to do address(this) now. …
n1cK's user avatar
  • 3,408
1 vote

Event to alert when receive a token

For this, you need to Write a function that emits a so called event. Events take parameters (the data you want to log). give the event a parameter of the type uint256 and put msg.value as that para …
n1cK's user avatar
  • 3,408
0 votes

How to take coins from a msg.sender? Or verify coins were sent?

it's almost impossible to make a contract generate randomnes] ) that generates a proposal for the number to be guessed, packed with some characters, > hashed, and then submitted < to the contract. in solidity
n1cK's user avatar
  • 3,408
0 votes

zeppelin-solidity Crowdsale. Access to token using javascript

return instance.publicMapping.call(mappingKey); }).then(function(result) { console.log(result.toString()); }).catch(function(e) { console.log(e); }); where mappingKey stands for the solidity
n1cK's user avatar
  • 3,408
0 votes

How to print transaction details like block number and other input parameters on front end?

It is highly recommended to use the Truffle Framework's JavaScript way of calling functions instead of jQuery, although Truffle's PetSShop tutorial shows otherwise. If you do truffle unbox webpack an …
n1cK's user avatar
  • 3,408
0 votes

How to include the named of the called contract in Event Log

This is not possible: There is no way (yet) for a contract to read another contract's name. If you know the contracts you are calling, you can reference their name by some identifier, either a strin …
n1cK's user avatar
  • 3,408
1 vote

Remix error : The constructor should be payable if you send value

In addition to the previous answer, which would lead you to a different issue, the original issue is that you have not marked the constructor function as payable although you send along some value dur …
n1cK's user avatar
  • 3,408
4 votes

Wrong parameter passed in the constructor. How can I fix it?

How can we fix this? If you havn't included a function to do so, not at all. Can I contact Etherscan for help I don't mean to be rude here, but if you are not clear about how etherscan and …
n1cK's user avatar
  • 3,408
0 votes

Solidity | Smart Contract (Ethereum) transaction tracker API

If your contract grants the right to someone to call a function, there is no way for you to stop him from doing this (when the transaction is already sent). Of course you can implement safety measures …
n1cK's user avatar
  • 3,408

15 30 50 per page