Skip to content

Commit

Permalink
chore(README.md): add sections
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmp01 committed Jul 23, 2024
1 parent 180abbb commit 09b8926
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions solidity/script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,38 @@ Import the testnet and production private keys (they will be placed into `~/.fou
Create an `.env` file like the following:

```bash
CHAIN=sepolia

SEPOLIA_RPC_URL=https://glory-rattish-sun.ethereum-sepolia.quiknode.pro/.../
ETHERSCAN_API_KEY=B7F...UURG
# This is used for Script.sh
RPC_URL=https://url-here.quicknode.io/
FORGE_KEYSTORE_PASSWORD=password

# This is used for foundry.toml
SEPOLIA_RPC_URL=https://url-here.quicknode.io/
ETHERSCAN_API_KEY=B7FH..G
ETH_KEYSTORE_ACCOUNT=testnet
```

Then the testnet account will be used throughout the scripts execution if no others are specified.
Go into the `script` folder and then interact with the relevant contract like follows:

```
./XERC20Registry.sh 'grantRegistrarRole(address,address)' 0x2ebc8a27ece2203c9d413a5c655fac7fb7d83262 0xADA2de876567a06eD79b0B29ae6aB2e142129E51
./ERC20.sh 'approve(address,address,uint256)' 0xf6652f1db7a7b48d9a6c515ad759c0464e16559c 0x87415715056da7a5eb1a30e53c4f4d20b44db71d 100000000000000000 --broadcast
./XERC20Registry.sh 'registerPair(address,address,address)' 0x2ebc8a27ece2203c9d413a5c655fac7fb7d83262 0xf6652f1db7a7b48d9a6c515ad759c0464e16559c 0xab4142adBF12c4403012D413945Be641e12237b5 --broadcast
### Run
./Adapter.sh 'swap(address,address,uint256,uint256,string memory,bytes memory)' 0x87415715056da7a5eb1a30e53c4f4d20b44db71d 0xf6652f1db7a7b48d9a6c515ad759c0464e16559c 100000000000000000 56 "0xADA2de876567a06eD79b0B29ae6aB2e142129E51" "0x" --broadcast
```

Check each `*.s.sol` contract to see the available scripts to run.

## Single contract deployment

```bash
forge create --chain sepolia --rpc-url "$SEPOLIA_RPC_URL" --password "$FORGE_KEYSTORE_PASSWORD" './src/xerc20/XERC20Lockbox.sol:XERC20Lockbox' --constructor-args 0xab4142adBF12c4403012D413945Be641e12237b5 0xf6652f1db7a7b48d9a6c515ad759c0464e16559c false
```

First deployment:
## Single contract verification

```bash
source .env
forge script --chain sepolia --rpc-url $SEPOLIA_RPC_URL script/Deploy.sol:Deploy --password <keystore-password> --broadcast
forge verify-contract --chain sepolia --rpc-url "$SEPOLIA_RPC_URL" --guess-constructor-args 0xb9a85A932432B19c1959aa29Fb50DBc5957751AF
```

0 comments on commit 09b8926

Please sign in to comment.