Linked Questions

6 votes
2 answers

Contract creation gas cost depends on code in library function?

I have a contract fooContract which is using a fooLib library, calling storage param) The transaction cost to create fooContract seems to depend on the code in the ...
12 votes
2 answers

Finding and Using Solidity Libraries (ie. Math functions)

How do I find and use any existing Solidity libraries like you might in Javascript? For example, Math functions: How do I implement the equivalent of Math.sqrt(x) in a solidity function? Related: ...
0 votes
2 answers

How connect library to smart contract from external resources?

Now I connect library SafeMath.sol in local project. pragma solidity ^0.4.15; import './ERC20.sol'; import './SafeMath.sol'; How can I connect SafeMath.sol from external(non-local) resources ...
2 votes
1 answer

Ethereum linking library with contract not working as accepted...returning any state variable returns just the default value

my library pragma solidity ^0.5.8; library SafeMath { function add(uint256 a,uint256 b) public pure returns (uint256) { return a+b; } } My contract pragma solidity ^0.5.8; import ...
29 votes
4 answers

what does `` exactly do in `truffle`

Please explain use cases for function in migrations in truffle framework. How would you use it and for what.
10 votes
2 answers

Trying to understand libraries

I have a library which I want to deploy followed by a number of differing contracts which link to it. However I seem to me missing some understanding about library deployment and utilisation. The ...
12 votes
1 answer

How to call a library contract

library ECVerify is deployed on 0x3bbb367afe5075e0461f535d6ed2a640822edb1c on the Ropsten test net. How do I call function ecverify(bytes32 hash, bytes sig, address signer) returns (bool) {} in that ...
9 votes
1 answer

How to link libraries in browser-solidity? [duplicate]

How to link library in browser-solidity? While creating a contract using library, solidity compiler requires to link the contract with the library. But there is no options in the browser to provide it....
2 votes
1 answer

Is it possible to link contracts to existing libraries from within geth console?

I've been making and deploying contracts and libraries, deploying libraries first and then using the binary output from e.g. $ solc --bin-runtime test.sol --libraries TestLib:...
5 votes
1 answer

How to deploy contract into local running node using solidity browser?

I am running a local ethereum node and I did unlock an account. Now I want to use the solidity browser to deploy that contract, but when I switch to the web3 provider deploy option and I press the ...
15 votes
1 answer

How should we set a import path in solidity?

I failed to compile a solidity file with import statement. Error: Source not found: File not found. import './contract.sol'; How should we set a import path? I used web3.js for compiling. ...