Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/contracts-bedrock/scripts/celo/gen_l2_token_cmds.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env fish

if [ -z "$argv" ];
echo Create commands to deploy L2 tokens for bridging from Ethereum
echo
echo "Usage: $(status filename) <l1_token_address> [<l1_token_address> ...]"
return
end

echo
echo "Commands to deploy L2 tokens for bridging from Ethereum:"
echo

set -x ETH_RPC_URL https://ethereum-rpc.publicnode.com

for address in $argv
set symbol (cast call $address "symbol() returns (string)" --json | jq -r '.[0]')
set name (cast call $address "name() returns (string)" --json | jq -r '.[0]')
set decimals (cast call $address "decimals() returns (uint256)" --json | jq -r '.[0]')
echo cast send 0x4200000000000000000000000000000000000012 "\"createOptimismMintableERC20WithDecimals(address,string,string,uint8)\"" $address "\"$name (Celo native bridge)\"" \"$symbol\" $decimals --private-key \$PRIVKEY
end
16 changes: 16 additions & 0 deletions packages/contracts-bedrock/scripts/celo/verify_token_blockscout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [ -z "$*" ]; then
echo "Verify L2 bridged tokens on Blockscout"
echo
echo "Usage: $0 <token_address> [<token_address> ...]"
exit 1
fi

for BRIDGED_TOKEN in "$@"; do
forge verify-contract \
--verifier=blockscout \
--verifier-url=https://celo.blockscout.com/api/ \
"$BRIDGED_TOKEN" \
src/universal/OptimismMintableERC20.sol:OptimismMintableERC20
done
31 changes: 31 additions & 0 deletions packages/contracts-bedrock/scripts/celo/verify_token_celoscan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

if [ -z "$*" ]; then
echo "Verify L2 bridged tokens on Celoscan"
echo
echo "Usage: $0 <token_address> [<token_address> ...]"
exit 1
fi

for BRIDGED_TOKEN in "$@"; do
# cast_call <address> <signature>
function cast_call() {
cast call --json --rpc-url https://forno.celo.org "$1" "$2" | jq -r ".[0]"
}

REMOTE_TOKEN=$(cast_call "$BRIDGED_TOKEN" "REMOTE_TOKEN()(address)")
NAME=$(cast_call "$BRIDGED_TOKEN" "name()(string)")
SYMBOL=$(cast_call "$BRIDGED_TOKEN" "symbol()(string)")
DECIMALS=$(cast_call "$BRIDGED_TOKEN" "decimals()(uint8)")

CONSTRUCTOR_ARGS=$(cast abi-encode "constructor(address,address,string,string,uint8)" 0x4200000000000000000000000000000000000010 "$REMOTE_TOKEN" "$NAME" "$SYMBOL" "$DECIMALS")
CONSTRUCTOR_ARGS=${CONSTRUCTOR_ARGS#0x}

forge verify-contract \
--verifier=etherscan \
--verifier-url=https://api.celoscan.io/api/ \
--constructor-args="$CONSTRUCTOR_ARGS" \
--skip-is-verified-check \
"$BRIDGED_TOKEN" \
src/universal/OptimismMintableERC20.sol:OptimismMintableERC20
done