Skip to content

Commit

Permalink
set new enviroment for use with ganache instead of anvil
Browse files Browse the repository at this point in the history
  • Loading branch information
ametel01 committed Jul 15, 2024
1 parent 1784563 commit 40b210e
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 60 deletions.
8 changes: 4 additions & 4 deletions anvil.messaging.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"chain": "ethereum",
"rpc_url": "http://127.0.0.1:8545",
"contract_address": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"sender_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"private_key": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
"rpc_url": "http://127.0.0.1:7545",
"contract_address": "0x27d3D261A62E82A47DdBcB2a7326398761BA95C5",
"sender_address": "0x6E7A2310e7E6A87f07B09e028EF281AAc6981c02",
"private_key": "0xce3ef648b7851e1884731ebafa4cbbc91a0bd3167ebef8b607f3aa2eed3ee8e2",
"interval": 2,
"from_block": 0
}
14 changes: 7 additions & 7 deletions ethereum/anvil.env
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# General config.
ETH_RPC_URL=http://127.0.0.1:8545
ETH_RPC_URL=HTTP://127.0.0.1:7545
ETHERSCAN_API_KEY=0x1

# Account related variables (EOA account).
ACCOUNT_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
ACCOUNT_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
ACCOUNT_PRIVATE_KEY=0xce3ef648b7851e1884731ebafa4cbbc91a0bd3167ebef8b607f3aa2eed3ee8e2
ACCOUNT_ADDRESS=0x6E7A2310e7E6A87f07B09e028EF281AAc6981c02

# Contracts on L1.
CONTRACT_MSG_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
L1_MESSAGE_SENDER_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
SN_MESSAGING_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
CONTRACT_MSG_ADDRESS=0x08a393Fe28Af83962C204709805469121f10910e
L1_MESSAGE_SENDER_ADDRESS=0xE7CF00da9CcAc9a3eE2B2f19F9CbF5851e31Ad0C
SN_MESSAGING_ADDRESS=0x27d3D261A62E82A47DdBcB2a7326398761BA95C5


# The "msg_handler_value" selector.
Expand All @@ -19,4 +19,4 @@ L2_SELECTOR_STRUCT=0x00f1149cade9d692862ad41df96b108aa2c20af34f640457e781d166c98
# Account contract address that send messages on L2.
L2_ACCOUNT=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
# Address of the L2 message proxy contract
L2_CONTRACT_ADDRESS=0x00ecee874a015525c1e2525fe405bf4e02da2f6cf3feb1ca39601a163f77ab00
L2_CONTRACT_ADDRESS=0x06980633e6c57b62bae4bfa609c9a3025f63ee63bdb78fd79a55899b5442f47e
2 changes: 1 addition & 1 deletion ethereum/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ libs = ["dependencies"]
fs_permissions = [{ access = "read-write", path = "./logs" }]

[dependencies]
forge-std = { version = "1.8.2", url = "https://github.com/foundry-rs/foundry.git" }
forge-std = "1.8.2"
4 changes: 2 additions & 2 deletions ethereum/script/LocalTesting.s.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "@forge-std/src/Script.sol";
import "@forge-std/src/console.sol";
import "forge-std/src/Script.sol";
import "forge-std/src/console.sol";

import "src/ContractMsg.sol";
import "src/L1MessageSender.sol";
Expand Down
2 changes: 1 addition & 1 deletion ethereum/script/SendMessage.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "@forge-std/src/Script.sol";
import "forge-std/src/Script.sol";

import "src/ContractMsg.sol";

Expand Down
6 changes: 6 additions & 0 deletions ethereum/soldeer.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ name = "forge-std"
version = "1.8.2"
source = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_8_2_19-05-2024_18:52:07_forge-std-1.8.2.zip"
checksum = "88a37e1d79f60b8aad08c7bd50a7a5ef973fc172b1495028d0725a17f5a4976c"

[[dependencies]]
name = "forge-std"
version = "1.8.2"
source = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_8_2_19-05-2024_18:52:07_forge-std-1.8.2.zip"
checksum = "88a37e1d79f60b8aad08c7bd50a7a5ef973fc172b1495028d0725a17f5a4976c"
27 changes: 0 additions & 27 deletions ethereum/test/MockStorageTest.t.sol

This file was deleted.

31 changes: 14 additions & 17 deletions starknet/katana/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash

# Load the addresses from the deployed-contracts.txt file
declare -A class_hashes
declare -A addresses

# Load the addresses from the declared-classes.txt file
while IFS= read -r line; do
contract_name=$(echo "$line" | cut -d ':' -f 1 | xargs)
class_hash=$(echo "$line" | cut -d ' ' -f 2 | xargs)

class_hashes["$contract_name"]=$class_hash
echo "Contract Name: $contract_name"
echo "Class Hash: $class_hash"
if [ "$contract_name" = "messages-proxy" ]; then
messages_proxy_class_hash=$class_hash
elif [ "$contract_name" = "headers-store" ]; then
headers_store_class_hash=$class_hash
elif [ "$contract_name" = "fact-registry" ]; then
fact_registry_class_hash=$class_hash
fi
done < katana/declared-classes.txt

messages_proxy_class_hash=${class_hashes["messages-proxy"]}
headers_store_class_hash=${class_hashes["headers-store"]}
fact_registry_class_hash=${class_hashes["fact-registry"]}

# Debug: Print the class_hashes
# Debug: Print the class hashes
echo "Fact Registry Class hash: $fact_registry_class_hash"
echo "Headers Store Class hash: $headers_store_class_hash"
echo "Messages Proxy Class hash: $messages_proxy_class_hash"
Expand All @@ -31,14 +31,13 @@ if [ -z "$l1_message_sender_address" ]; then
exit 1
fi

# Remove existing declared-classes.txt file if it exists
# Remove existing deployed-contracts.txt file if it exists
rm -f katana/deployed-contracts.txt

# Perform Deployment
# Message Proxy Deployment
echo "Deploying messages-proxy with L1_MESSAGE_SENDER_ADDRESS and owner address..."
output=$(starkli deploy "$messages_proxy_class_hash" "$l1_message_sender_address" "$owner_address" --salt 0x1 -w)
# output=$(starkli deploy "$messages_proxy_class_hash" "$l1_message_sender_address" katana-1 --salt 0x1 -w)
echo "messages-proxy: $output" >> katana/deployed-contracts.txt
messages_proxy=$output
echo "Messages Proxy address: $messages_proxy"
Expand All @@ -63,11 +62,9 @@ echo "Fact Registry address: $fact_registry"
echo "Deployment address for fact-registry saved to deployed-contracts.txt"

echo "Deployment complete."

echo " "

#Set l1_headers_store_address for messages-proxy
# Set l1_headers_store_address for messages-proxy
echo "Setting headers-store for messages-proxy contract..."
output=$(starkli invoke "$messages_proxy" set_l1_headers_store "$headers_store" --account katana-0 -w)

echo "l1_headers_store_address set complete."
echo "l1_headers_store_address set complete."
2 changes: 1 addition & 1 deletion starknet/katana/katana.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export STARKNET_ACCOUNT=katana-0
export STARKNET_RPC=http://0.0.0.0:5050
export OWNER_ADDRESS=0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03
export STARKNET_HANDLER_ADDRESS=0xe29882a1fcba1e7e10cad46212257fea5c752a4f9b1b1ec683c503a2cf5c8a
export L1_MESSAGE_SENDER_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
export L1_MESSAGE_SENDER_ADDRESS=0xE7CF00da9CcAc9a3eE2B2f19F9CbF5851e31Ad0C

0 comments on commit 40b210e

Please sign in to comment.