Truffle部署多个合约

比如我想用ERC721合约,相关的依赖合约有

import "./Context.sol";
import "./IERC721.sol";
import "./IERC721Metadata.sol";
import "./IERC721Enumerable.sol";
import "./IERC721Receiver.sol";
import "./ERC165.sol";
import "./SafeMath.sol";
import "./Address.sol";
import "./EnumerableSet.sol";
import "./EnumerableMap.sol";
import "./Strings.sol"

请问有没有简单的方式部署呢?我看到在详解truffle migration一文是用的下面方法

**var** Storage = artifacts.require(**"./Storage.sol"**);
**var** InfoManager = artifacts.require(**"./InfoManager.sol"**);

**module**.exports = **function****(****deployer****) **{

**// 部署 Storage**
deployer.deploy(Storage)
**// 等待、直到合约部署完成**
.then(**()**** =>** Storage.deployed())
**// 传递 Storage 合约地址,部署 InfoManager 合约**
.then(**()**** =>** deployer.deploy(InfoManager, Storage.address));
请先 登录 后评论

1 个回答

admin
请先 登录 后评论
  • 1 关注
  • 0 收藏,2670 浏览
  • Axelord 提出于 2021-04-21 22:36