December 2018
Beginner to intermediate
564 pages
17h 34m
English
Sometimes, you may want your contracts to interact with the package's previously deployed contracts. Since the deployed addresses exist within the package's .json files, Solidity code cannot directly read contents of these files. So, the flow of making Solidity code access the addresses in .json files is by defining functions in Solidity code to set dependent contract addresses, and after the contract is deployed, call those functions using JavaScript to set the dependent contract addresses.
So you can define your contract code like this:
import "example-truffle-library/contracts/SimpleNameRegistry.sol"; contract MyContract { SimpleNameRegistry registry; address public owner; ...Read now
Unlock full access