Linked Questions

9
votes
1answer
3k views

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....
25
votes
4answers
4k views

what does `deploy.link` exactly do in `truffle`

Please explain use cases for deploy.link() function in migrations in truffle framework. How would you use it and for what.
14
votes
1answer
6k views

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. ...
10
votes
1answer
5k views

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
1answer
3k views

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: ...
10
votes
2answers
2k views

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 ...
5
votes
1answer
4k views

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 ...
4
votes
2answers
774 views

Contract creation gas cost depends on code in library function?

I have a contract fooContract which is using a fooLib library, calling fooLib.foo(LibStruct storage param) The transaction cost to create fooContract seems to depend on the code in the fooLib.foo() ...
0
votes
1answer
816 views

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
1answer
117 views

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:...
1
vote
1answer
28 views

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 ...