Example implementation of EIP-6358
Prerequisites
- truffle >= v5.7.9
- node >= v18.12.1
- npm >= 8.19.2
- npx >= 8.19.2
Installation
npm install
Add the configuration file truffle-config.js into the directory ./. The file truffle-config.js can be generated by executing the command in an $empty directory$:
npx truffle init
Note that:
- type
Nwhen askedOverwrite contracts? - type
Nwhen askedOverwrite migrations? - type
Nwhen askedOverwrite test?
After truffle-config.js is generated, then:
- Uncommnet the content of
development, like this:
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
Compilation
touch .secret
npx truffle compile
Unit test
Launch local testnet
npx ganache -s 0
Test
Open another terminate
npx truffle test