diff --git a/packages/protocol/scripts/foundry/constants.sh b/packages/protocol/scripts/foundry/constants.sh index 2cfeb976cd7..d26a25b413d 100755 --- a/packages/protocol/scripts/foundry/constants.sh +++ b/packages/protocol/scripts/foundry/constants.sh @@ -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" diff --git a/packages/protocol/scripts/foundry/create_and_migrate_anvil_devchain.sh b/packages/protocol/scripts/foundry/create_and_migrate_anvil_devchain.sh index ce6a48e6d94..6ed81942495 100755 --- a/packages/protocol/scripts/foundry/create_and_migrate_anvil_devchain.sh +++ b/packages/protocol/scripts/foundry/create_and_migrate_anvil_devchain.sh @@ -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))