diff --git a/deploy_rln_contract.sh b/deploy_rln_contract.sh index ec68b10..6f1a6ff 100644 --- a/deploy_rln_contract.sh +++ b/deploy_rln_contract.sh @@ -14,28 +14,28 @@ curl -o "$waku_rln_registry_impl_json" "$repo_url$waku_rln_registry_impl_json" curl -o "$waku_rln_registry_proxy_json" "$repo_url$waku_rln_registry_proxy_json" json_contents=$(cat $poseidon_hasher_json) -poseidon_hasher_bytecodeA=$(echo "$json_contents" | grep -o 'bytecode\\"[^,]*' | awk -F '0x' '{print "0x" substr($2, 1, length($2)-2)}') +poseidon_hasher_bytecode=$(echo "$json_contents" | grep -o 'bytecode\\"[^,]*' | awk -F '0x' '{print "0x" substr($2, 1, length($2)-2)}') json_contents=$(cat $waku_rln_registry_impl_json) -waku_rln_registry_impl_bytecodeA=$(echo "$json_contents" | grep -o 'bytecode\\"[^,]*' | awk -F '0x' '{print "0x" substr($2, 1, length($2)-2)}') +waku_rln_registry_impl_bytecode=$(echo "$json_contents" | grep -o 'bytecode\\"[^,]*' | awk -F '0x' '{print "0x" substr($2, 1, length($2)-2)}') json_contents=$(cat $waku_rln_registry_proxy_json) -waku_rln_registry_proxy_bytecodeA=$(echo "$json_contents" | grep -o 'bytecode\\"[^,]*' | awk -F '0x' '{print "0x" substr($2, 1, length($2)-2)}') +waku_rln_registry_proxy_bytecode=$(echo "$json_contents" | grep -o 'bytecode\\"[^,]*' | awk -F '0x' '{print "0x" substr($2, 1, length($2)-2)}') echo "Deploying RLN contracts..." # 2. Deploy Poseidon Hasher -poseidon_address=$(cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY --create $poseidon_hasher_bytecodeA | grep contractAddress | cut -d' ' -f10) +poseidon_address=$(cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY --create $poseidon_hasher_bytecode | grep contractAddress | cut -d' ' -f10) # 3. Deploy Waku Rln Registry Implementation -implementation_address=$(cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY --create $waku_rln_registry_impl_bytecodeA | grep contractAddress | cut -d' ' -f10) +implementation_address=$(cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY --create $waku_rln_registry_impl_bytecode | grep contractAddress | cut -d' ' -f10) # 4. Concatenate Waku Rln Registry Proxy Bytecode with constructor arguments in the form of # constructor(address implementation, bytes memory data) # where data = abi.encodeWithSignature("initialize(address)", address(poseidonHasher)) constructor_arguments=$(cast abi-encode "constructor(address impl, bytes data)" "$implementation_address" $(cast calldata "initialize(address)" "$poseidon_address") | cut -c 3-) -waku_rln_registry_proxy_bytecode_with_constructor_arguments="$waku_rln_registry_proxy_bytecodeA$constructor_arguments" +waku_rln_registry_proxy_bytecode_with_constructor_arguments="$waku_rln_registry_proxy_bytecode$constructor_arguments" # 5. Deploy Waku Rln Registry Proxy waku_rln_registry_proxy_address=$(cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY --create $waku_rln_registry_proxy_bytecode_with_constructor_arguments | grep contractAddress | cut -d' ' -f10)