Linked Questions
11 questions linked to/from What are the steps to compile and deploy a library in Solidity?
29
votes
4
answers
9k
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.
12
votes
2
answers
5k
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
2
answers
3k
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 ...
6
votes
2
answers
2k
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
2
answers
1k
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 ...
15
votes
1
answer
11k
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.
...
12
votes
1
answer
8k
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
1
answer
4k
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....
5
votes
1
answer
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 ...
2
votes
1
answer
251
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 ...
2
votes
1
answer
244
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:...