Skip to content

Commit

Permalink
fix: Update/fix testnet support
Browse files Browse the repository at this point in the history
  • Loading branch information
miltonjonat committed Aug 31, 2023
1 parent e42a41f commit b3b6e5a
Show file tree
Hide file tree
Showing 13 changed files with 824 additions and 5,615 deletions.
8 changes: 3 additions & 5 deletions common-contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/artifacts
cache
contracts.json
coverage*
deployments/localhost
deployments/*/solcInputs/*.json
abi
dist
deployments
export
node_modules
src/types
test/*/
Expand Down
30 changes: 22 additions & 8 deletions common-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,38 @@ yarn && yarn build

Usually, DApps that require these contracts will specify their deployment within their corresponding `docker-compose.override.yml` file.

Additionally, the project can be deployed manually on the local development network by running `yarn deploy`.
Additionally, the project can be deployed manually on the local development network by running `yarn deploy`. Manual deployment to other supported testnets can be done by executing `yarn deploy:<network>`.

Manual deployment to other supported testnets can also be done.

Check failure on line 22 in common-contracts/README.md

View workflow job for this annotation

GitHub Actions / Lint

Multiple consecutive blank lines [Expected: 1; Actual: 2]

common-contracts/README.md:22 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
As a first step, set a 12-word mnemonic phrase:
## SimpleERC20 Contract

This is a simple contract to perform operations with fungible tokens.

To use it, you must first retrieve the contract address from the deployment data.
For the local development network, execute the following command:

```shell
export MNEMONIC=<12-word backup phrase>
ERC_20=$(jq '.address' ./deployments/localhost/SimpleERC20.json | \
sed "s/[\",]//g")
```

Then, in the case of deployments to Ethereum networks, set an Infura project ID:
With that in place, you can make transactions such as transferring tokens between accounts:

```shell
export PROJECT_ID=<Infura project ID>
cast send $ERC_20 \
"transfer(address,uint256)(bool)" \
0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \
1000 \
--mnemonic "test test test test test test test test test test test junk" \
--mnemonic-index 0 \
--rpc-url "http://localhost:8545"
```

Finally, execute:
The balance of an address can also be queried with the following command:

```shell
yarn deploy:<network>
cast call $ERC_20 \
"balanceOf(address)(uint32)" \
0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \
--rpc-url "http://localhost:8545"
```
297 changes: 0 additions & 297 deletions common-contracts/export/abi/sepolia.json

This file was deleted.

Loading

0 comments on commit b3b6e5a

Please sign in to comment.