//@openzeppelin/contracts-ethereum-package //安装 sudo npm install @openzeppelin/contracts-ethereum-package --unsafe-perm=true --allow-root //将OpenZeppelin合约以太坊软件包链接到项目中 npx oz link @openzeppelin/contracts-ethereum-package //执行命令选择选项就可以发行Token npx oz create The create command is deprecated. Use deploy instead. Nothing to compile, all contracts are up to date. ? Pick a contract to instantiate @openzeppelin/contracts-ethereum-package/ERC20PresetMinterPauserUpgrade Safe ? Pick a network rinkeby ✓ Linked dependency @openzeppelin/contracts-ethereum-package 3.0.0 All implementations are up to date ? Call a function to initialize the instance after creating it? Yes ? Select which function initialize(name: string, symbol: string) ? name: string: NewToken ? symbol: string: NETO ✓ Instance created at 0xaD5be79048996817D0cdCbee2EdAFF78CAE7f103 To upgrade this instance run 'oz upgrade' 0xaD5be79048996817D0cdCbee2EdAFF78CAE7f103 //查询用户token数量 npx oz balance --erc20 0xaD5be79048996817D0cdCbee2EdAFF78CAE7f103 ? Enter an address to query its balance 0x857eF46Cd9609Fb4098353a64F62Cfd99Be67266 ? Pick a network rinkeby Balance: 0 NETO
npx oz create The create command is deprecated. Use deploy instead. Nothing to compile, all contracts are up to date. ? Pick a contract to instantiate TokenExchange ? Pick a network rinkeby ✓ Added contract TokenExchange ✓ Contract TokenExchange deployed All implementations have been deployed ? Call a function to initialize the instance after creating it? Yes ? Select which function initialize(_rate: uint256, _token: address) ? _rate: uint256: 10 ? _token: address: 0xaD5be79048996817D0cdCbee2EdAFF78CAE7f103 ✓ Instance created at 0x88dDC24f17D2938Af7769acea0D1e0F7583500e1