Skip to content

Commit

Permalink
Resolved merged conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
byteZorvin committed Dec 9, 2023
1 parent 3d9289b commit f1ed6f2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions examples/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ async fn main() -> eyre::Result<()> {
dotenv().ok();
let priv_key = env::var("ENV_PRIV_KEY_PATH").expect("You've not set the Pvt key");
let proxy_contract_address = "0x117693Ba99250A53BBFdC1720Ebe9C4F06fDfa9c";
let counter_v1_address: Address = ("0x280D5a75ca406c9C427aE2c3b999f8dd4C57D119").parse()?;
let counter_v2_address: Address = ("aldj").parse()?;


let rpc_url = "https://stylus-testnet.arbitrum.io/rpc";
abigen!(
Proxy,
Expand All @@ -43,6 +47,17 @@ async fn main() -> eyre::Result<()> {
function setNumber(uint256 new_number) external
function increment() external
event NumberSet(uint256 number)
]"#
);

abigen!(
CounterV2,
r#"[
function number() external view returns (uint256);
function setNumber(uint256 new_number) external;
function increment() external;
function decrement() external;
event NumberSet(uint256 number)
]"#
);

Expand All @@ -54,12 +69,15 @@ async fn main() -> eyre::Result<()> {
provider,
wallet.clone().with_chain_id(chain_id),
));

let proxy = Proxy::new(address, client.clone());
let proxy = Proxy::new(address, client);
let _owner_address: Address = ("0x3647fc3a4209a4b302dcf8f7bb5d58defa6b9708").parse()?;
// proxy.init(_owner_address).send().await?.await?;
// println!("Init successful");

proxy.set_implementation(counter_v1_address).send().await?.await?;
println!("Called Set implementation successfully");

let implementation_address: Address = proxy.get_implementation().call().await?;
println!(
"Current implementation address: {:?}",
Expand Down Expand Up @@ -132,5 +150,12 @@ async fn main() -> eyre::Result<()> {
// proxy.relay_to_implementation_try().send().await?.await?;
// println!("Relayed data try: {:?}", relayed_data_try);


// proxy.set_implementation(counter_v2_address).send().await?.await?;
// println!("Called Set implementation successfully");

// let updated_implementation_address = proxy.get_implementation().call().await?;
// println!("Updated implementation address: {:?}", updated_implementation_address);

Ok(())
}

0 comments on commit f1ed6f2

Please sign in to comment.