Install dependencies:
nvm use # Should install node 10.16.0
npm install -g ganache-cli
npm install
Run Ganache:
ganache-cli --port 9545 --deterministic
Any time you shutdown ganache, you will need to do zos push
and zos create
to deploy the project into the blank blockchain.
npx zos session --network local --from 0x1df62f291b2e969fb0849d99d9ce41e2f137006e --expires 3600
zos push
zos create XPoap --init initialize --args '"Poap","POAP","https://poap.xyz",[]'
To run a console:
npx truffle console --network local
To run tests:
npx truffle test
Start by creating a session:
npx zos session --network local --from 0x1df62f291b2e969fb0849d99d9ce41e2f137006e --expires 3600
This creates a "connection" that will be used for every zos command. We define which network to connect, which account to use by default for all transaction and when it expires (3600 seconds after last used).
If no current session exists, or it its expired we need to create one.
When we create a new contract run:
npx zos add MyContract
To upgrade a current contract (change the code of it)
npx zos update MyContract
After any change we need to push the changes:
npx zos push
add
and update
only change the contract instance, but they don't actually release/create an instance of that contract.
To create an instance we do:
npz zos create MyContract --init initialize --args 42,hitchhiker
- Mainnet: 0x22c1f6050e56d2876009903609a2cc3fef83b415
- xDAI: 0x22c1f6050e56d2876009903609a2cc3fef83b415
- Rinkeby:
- Sokol: 0x22c1f6050e56d2876009903609a2cc3fef83b415
- Binance Smart Chain: 0xe310633E107e87F8Dfe50b00C360be60e926A1d6