Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Jul 29, 2024
1 parent 3c380b6 commit 965bb57
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/protocol/scripts/foundry/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export PROXY_ADMIN_ADDRESS='0x4200000000000000000000000000000000000018' # This a
export ADDRESS_ZERO="0x0000000000000000000000000000000000000000"
export CELO_VM_ADDRESS=$ADDRESS_ZERO

export ETHER_IN_WEI=1000000000000000000

# Contract configurations
export COMMUNITY_REWARD_FRACTION="100000000000000000000" # 0.01 in fixidity format
export CARBON_OFFSETTING_PARTNER="0x22579CA45eE22E2E16dDF72D955D6cf4c767B0eF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,22 @@ CELO_ADDRESS=`cast call $REGISTRY_ADDRESS "getAddressForStringOrDie(string calld
cast rpc anvil_impersonateAccount $CELO_VM_ADDRESS --rpc-url $ANVIL_RPC_URL

# set the balance of the vm address so that it can send a tx
cast rpc anvil_setBalance $CELO_VM_ADDRESS 1000000000000000000 --rpc-url $ANVIL_RPC_URL

# increase the supply
# 540001000000000000000000 = (60e3 + 1) * 9 * 10^18
cast send --from $CELO_VM_ADDRESS --unlocked $CELO_ADDRESS "increaseSupply(uint256)" 540001000000000000000000 --rpc-url $ANVIL_RPC_URL
cast rpc anvil_setBalance $CELO_VM_ADDRESS $ETHER_IN_WEI --rpc-url $ANVIL_RPC_URL

# increase the supply (it is harcoded as bash overflows)
# ideally this number should come from the amount of address funded when Anvil loads
# 540001000000000000000000 = (60e3 * 9 + 1) * 10^18 60K per account * 9 accounts + 1 for the VM (gas)
INITIAL_SUPPLY="540001000000000000000000"
cast send \
--from $CELO_VM_ADDRESS \
--unlocked $CELO_ADDRESS "increaseSupply(uint256)" $INITIAL_SUPPLY \
--rpc-url $ANVIL_RPC_URL

# stop impersonating the VM address
cast rpc anvil_stopImpersonatingAccount $CELO_VM_ADDRESS --rpc-url $ANVIL_RPC_URL
cast rpc \
anvil_stopImpersonatingAccount \
$CELO_VM_ADDRESS \
--rpc-url $ANVIL_RPC_URL

# Keeping track of the finish time to measure how long it takes to run the script entirely
ELAPSED_TIME=$(($SECONDS - $START_TIME))
Expand Down

0 comments on commit 965bb57

Please sign in to comment.