Skip to content

Commit

Permalink
Compile and deploy the contract example.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgcardona committed Mar 2, 2021
1 parent 42b2638 commit 4946dd8
Showing 1 changed file with 65 additions and 22 deletions.
87 changes: 65 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,27 +223,70 @@ Importing AVAX to the C-Chain...
Confirm each of the accounts are funded with 1000 AVAX.

```zsh
yarn balances
yarn balances --network avash
yarn run v1.22.4
$ npx hardhat balances --network avash
0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC has balance 1000000000000000000000
0x9632a79656af553F58738B0FB750320158495942 has balance 1000000000000000000000
0x55ee05dF718f1a5C1441e76190EB1a19eE2C9430 has balance 1000000000000000000000
0x4Cf2eD3665F6bFA95cE6A11CFDb7A2EF5FC1C7E4 has balance 1000000000000000000000
0x0B891dB1901D4875056896f28B6665083935C7A8 has balance 1000000000000000000000
0x01F253bE2EBF0bd64649FA468bF7b95ca933BDe2 has balance 1000000000000000000000
0x78A23300E04FB5d5D2820E23cc679738982e1fd5 has balance 1000000000000000000000
0x3C7daE394BBf8e9EE1359ad14C1C47003bD06293 has balance 1000000000000000000000
0x61e0B3CD93F36847Abbd5d40d6F00a8eC6f3cfFB has balance 1000000000000000000000
0x0Fa8EA536Be85F32724D57A37758761B86416123 has balance 1000000000000000000000
✨ Done in 0.72s.
```

Send each of the accounts some AVAX from the first account.

```zsh
yarn send-avax --network avash
yarn run v1.22.4
$ npx hardhat balances
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 has balance 10000000000000000000000
0x70997970C51812dc3A010C7d01b50e0d17dc79C8 has balance 10000000000000000000000
0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC has balance 10000000000000000000000
0x90F79bf6EB2c4f870365E785982E1f101E93b906 has balance 10000000000000000000000
0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 has balance 10000000000000000000000
0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc has balance 10000000000000000000000
0x976EA74026E726554dB657fA54763abd0C3a0aa9 has balance 10000000000000000000000
0x14dC79964da2C08b23698B3D3cc7Ca32193d9955 has balance 10000000000000000000000
0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f has balance 10000000000000000000000
0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 has balance 10000000000000000000000
0xBcd4042DE499D14e55001CcbB24a551F3b954096 has balance 10000000000000000000000
0x71bE63f3384f5fb98995898A86B02Fb2426c5788 has balance 10000000000000000000000
0xFABB0ac9d68B0B445fB7357272Ff202C5651694a has balance 10000000000000000000000
0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec has balance 10000000000000000000000
0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097 has balance 10000000000000000000000
0xcd3B766CCDd6AE721141F452C550Ca635964ce71 has balance 10000000000000000000000
0x2546BcD3c84621e976D8185a91A922aE77ECEc30 has balance 10000000000000000000000
0xbDA5747bFD65F08deb54cb465eB87D40e51B197E has balance 10000000000000000000000
0xdD2FD4581271e230360230F9337D5c0430Bf44C0 has balance 10000000000000000000000
0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199 has balance 10000000000000000000000
$ npx hardhat run scripts/sendAvax.js --network avash
Seeding addresses with AVAX
✨ Done in 1.33s.
```

Confirm that the balances are updated

```zsh
yarn balances --network avash
yarn run v1.22.4
$ npx hardhat balances --network avash
0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC has balance 999821170000000000000
0x9632a79656af553F58738B0FB750320158495942 has balance 1000010000000000000000
0x55ee05dF718f1a5C1441e76190EB1a19eE2C9430 has balance 1000010000000000000000
0x4Cf2eD3665F6bFA95cE6A11CFDb7A2EF5FC1C7E4 has balance 1000010000000000000000
0x0B891dB1901D4875056896f28B6665083935C7A8 has balance 1000010000000000000000
0x01F253bE2EBF0bd64649FA468bF7b95ca933BDe2 has balance 1000010000000000000000
0x78A23300E04FB5d5D2820E23cc679738982e1fd5 has balance 1000010000000000000000
0x3C7daE394BBf8e9EE1359ad14C1C47003bD06293 has balance 1000010000000000000000
0x61e0B3CD93F36847Abbd5d40d6F00a8eC6f3cfFB has balance 1000010000000000000000
0x0Fa8EA536Be85F32724D57A37758761B86416123 has balance 1000010000000000000000
```

Compile the smart contract.

```zsh
yarn compile
yarn run v1.22.4
$ rimraf ./build/
$ npx hardhat compile
Compiling 1 file with 0.6.4
Compilation finished successfully
✨ Done in 2.13s.
```

Deploy the contract to the `avash` local network

```zsh
yarn deploy --network avash
yarn run v1.22.4
$ npx hardhat run scripts/deploy.js --network avash
Coin deployed to: 0x789a5FDac2b37FCD290fb2924382297A6AE65860
✨ Done in 1.28s.
```

We now have a token deployed at `0x789a5FDac2b37FCD290fb2924382297A6AE65860`. The `constructor` function of [this token](contracts/Coin.sol#L15) `mint`s the `TOTAL_BALANCE` to the account which called the contract.

0 comments on commit 4946dd8

Please sign in to comment.