From 0a50863d8a92ca5cbaf675a6685c9a48017929fa Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Tue, 14 Jan 2025 14:04:45 +0330 Subject: [PATCH 01/11] feat: add option to adjust contract balance on deployment if already funded --- zilliqa/src/cfg.rs | 6 ++++++ zilliqa/src/exec.rs | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/zilliqa/src/cfg.rs b/zilliqa/src/cfg.rs index c751d99ec..e4dfd56a0 100644 --- a/zilliqa/src/cfg.rs +++ b/zilliqa/src/cfg.rs @@ -432,6 +432,7 @@ impl Default for Forks { failed_scilla_call_from_gas_exempt_caller_causes_revert: true, call_mode_1_sets_caller_to_parent_caller: true, scilla_messages_can_call_evm_contracts: true, + adjust_contract_balance_on_deployment_if_contract_address_already_funded: true, }] .try_into() .unwrap() @@ -473,6 +474,11 @@ pub struct Fork { /// EOA (i.e. any ZIL passed will be transferred to the contract and execution will continue). If false, sending a /// Scilla message to an EVM contract will cause the Scilla transaction to fail. pub scilla_messages_can_call_evm_contracts: bool, + + /// If true, when a contract is deployed, if the contract address is already funded, + /// the contract balance will be sum of the existing balance and the amount sent in the deployment transaction. + /// If false, the contract balance will be the amount sent in the deployment transaction. + pub adjust_contract_balance_on_deployment_if_contract_address_already_funded: bool, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/zilliqa/src/exec.rs b/zilliqa/src/exec.rs index 93655b64a..edec54a75 100644 --- a/zilliqa/src/exec.rs +++ b/zilliqa/src/exec.rs @@ -659,6 +659,7 @@ impl State { current_block, inspector, &self.scilla_ext_libs_path, + self.forks.get(current_block.number), ) } else { scilla_call( @@ -1526,6 +1527,7 @@ fn scilla_create( current_block: BlockHeader, mut inspector: impl ScillaInspector, scilla_ext_libs_path: &ScillaExtLibsPath, + fork: Fork, ) -> Result<(ScillaResult, PendingState)> { if txn.data.is_empty() { return Err(anyhow!("contract creation without init data")); @@ -1628,6 +1630,11 @@ fn scilla_create( let transitions = contract_info.transitions; let account = state.load_account(contract_address)?; + if fork.adjust_contract_balance_on_deployment_if_contract_address_already_funded { + account.account.balance += txn.amount.get(); + } else { + account.account.balance = txn.amount.get(); + } account.account.balance = txn.amount.get(); account.account.code = Code::Scilla { code: txn.code.clone(), From bf881a6d3e3ed238c6bcdda8de12ffcb49947560 Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Tue, 14 Jan 2025 16:57:23 +0330 Subject: [PATCH 02/11] fix clippy --- zilliqa/src/exec.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/zilliqa/src/exec.rs b/zilliqa/src/exec.rs index edec54a75..992ac972a 100644 --- a/zilliqa/src/exec.rs +++ b/zilliqa/src/exec.rs @@ -1519,6 +1519,7 @@ pub fn store_external_libraries( Ok((ext_libs_dir_in_zq2, ext_libs_dir_in_scilla)) } +#[allow(clippy::too_many_arguments)] fn scilla_create( mut state: PendingState, scilla: MutexGuard<'_, Scilla>, From 8d28047db85d40b95210ab7c5faef237695a31d0 Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Wed, 15 Jan 2025 13:28:29 +0330 Subject: [PATCH 03/11] feat: introduce DeltaForks structure for enhanced fork configuration --- zilliqa/src/cfg.rs | 180 +++++++++++++++++++++++++++++++++++++++++-- zilliqa/src/state.rs | 2 +- 2 files changed, 176 insertions(+), 6 deletions(-) diff --git a/zilliqa/src/cfg.rs b/zilliqa/src/cfg.rs index e4dfd56a0..62b85f8b5 100644 --- a/zilliqa/src/cfg.rs +++ b/zilliqa/src/cfg.rs @@ -366,7 +366,7 @@ pub struct ConsensusConfig { /// Forks in block execution logic. Each entry describes the difference in logic and the block height at which that /// difference applies. #[serde(default)] - pub forks: Forks, + pub forks: DeltaForks, } impl Default for ConsensusConfig { @@ -397,6 +397,50 @@ impl Default for ConsensusConfig { } } +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct DeltaForks(Vec); +impl Default for DeltaForks { + fn default() -> Self { + DeltaForks(vec![DeltaFork { + at_height: 0, + failed_scilla_call_from_gas_exempt_caller_causes_revert: Some(true), + call_mode_1_sets_caller_to_parent_caller: Some(true), + scilla_messages_can_call_evm_contracts: Some(true), + adjust_contract_balance_on_deployment_if_contract_address_already_funded: Some(true), + }]) + } +} + +impl From for Forks { + fn from(delta_forks: DeltaForks) -> Self { + let mut forks: Vec = vec![]; + for delta in delta_forks.0 { + if let Some(last_fork) = forks.last() { + let new_fork = last_fork.apply_delta_fork(&delta); + forks.push(new_fork); + } else { + let base_fork = Fork { + at_height: delta.at_height, + failed_scilla_call_from_gas_exempt_caller_causes_revert: delta + .failed_scilla_call_from_gas_exempt_caller_causes_revert + .unwrap_or(true), + call_mode_1_sets_caller_to_parent_caller: delta + .call_mode_1_sets_caller_to_parent_caller + .unwrap_or(true), + scilla_messages_can_call_evm_contracts: delta + .scilla_messages_can_call_evm_contracts + .unwrap_or(true), + adjust_contract_balance_on_deployment_if_contract_address_already_funded: delta + .adjust_contract_balance_on_deployment_if_contract_address_already_funded + .unwrap_or(true), + }; + forks.push(base_fork); + } + } + Forks(forks) + } +} + #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(try_from = "Vec", into = "Vec")] pub struct Forks(Vec); @@ -455,11 +499,20 @@ impl Forks { #[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub struct Fork { + pub at_height: u64, + pub failed_scilla_call_from_gas_exempt_caller_causes_revert: bool, + pub call_mode_1_sets_caller_to_parent_caller: bool, + pub scilla_messages_can_call_evm_contracts: bool, + pub adjust_contract_balance_on_deployment_if_contract_address_already_funded: bool, +} + +#[derive(Copy, Clone, Debug, Serialize, Deserialize)] +pub struct DeltaFork { pub at_height: u64, /// If true, if a caller who is in the `scilla_call_gas_exempt_addrs` list makes a call to the `scilla_call` /// precompile and the inner Scilla call fails, the entire transaction will revert. If false, the normal EVM /// semantics apply where the caller can decide how to act based on the success of the inner call. - pub failed_scilla_call_from_gas_exempt_caller_causes_revert: bool, + pub failed_scilla_call_from_gas_exempt_caller_causes_revert: Option, /// If true, if a call is made to the `scilla_call` precompile with `call_mode` / `keep_origin` set to `1`, the /// `_sender` of the inner Scilla call will be set to the caller of the current call-stack. If false, the `_sender` /// will be set to the original transaction signer. @@ -469,16 +522,38 @@ pub struct Fork { /// /// When this flag is true, `D` will see the `_sender` as `B`. When this flag is false, `D` will see the `_sender` /// as `A`. - pub call_mode_1_sets_caller_to_parent_caller: bool, + pub call_mode_1_sets_caller_to_parent_caller: Option, /// If true, when a Scilla message is sent to an EVM contract, the EVM contract will be treated as if it was an /// EOA (i.e. any ZIL passed will be transferred to the contract and execution will continue). If false, sending a /// Scilla message to an EVM contract will cause the Scilla transaction to fail. - pub scilla_messages_can_call_evm_contracts: bool, + pub scilla_messages_can_call_evm_contracts: Option, /// If true, when a contract is deployed, if the contract address is already funded, /// the contract balance will be sum of the existing balance and the amount sent in the deployment transaction. /// If false, the contract balance will be the amount sent in the deployment transaction. - pub adjust_contract_balance_on_deployment_if_contract_address_already_funded: bool, + pub adjust_contract_balance_on_deployment_if_contract_address_already_funded: Option, +} + +impl Fork { + pub fn apply_delta_fork(&self, delta: &DeltaFork) -> Fork { + Fork { + at_height: delta.at_height, + failed_scilla_call_from_gas_exempt_caller_causes_revert: delta + .failed_scilla_call_from_gas_exempt_caller_causes_revert + .unwrap_or(self.failed_scilla_call_from_gas_exempt_caller_causes_revert), + call_mode_1_sets_caller_to_parent_caller: delta + .call_mode_1_sets_caller_to_parent_caller + .unwrap_or(self.call_mode_1_sets_caller_to_parent_caller), + scilla_messages_can_call_evm_contracts: delta + .scilla_messages_can_call_evm_contracts + .unwrap_or(self.scilla_messages_can_call_evm_contracts), + adjust_contract_balance_on_deployment_if_contract_address_already_funded: delta + .adjust_contract_balance_on_deployment_if_contract_address_already_funded + .unwrap_or( + self.adjust_contract_balance_on_deployment_if_contract_address_already_funded, + ), + } + } } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -560,3 +635,98 @@ impl ContractUpgradesBlockHeights { ) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_single_delta_fork() { + let delta_forks = DeltaForks(vec![DeltaFork { + at_height: 0, + failed_scilla_call_from_gas_exempt_caller_causes_revert: Some(true), + call_mode_1_sets_caller_to_parent_caller: Some(false), + scilla_messages_can_call_evm_contracts: Some(true), + adjust_contract_balance_on_deployment_if_contract_address_already_funded: Some(false), + }]); + + let result = Forks::try_from(delta_forks).unwrap(); + assert_eq!(result.0.len(), 1); + assert_eq!(result.0[0].at_height, 0); + assert_eq!(result.0[0].call_mode_1_sets_caller_to_parent_caller, false); + assert_eq!( + result.0[0].adjust_contract_balance_on_deployment_if_contract_address_already_funded, + false + ); + } + + #[test] + fn test_multiple_delta_forks() { + let delta_forks = DeltaForks(vec![ + DeltaFork { + at_height: 0, + failed_scilla_call_from_gas_exempt_caller_causes_revert: Some(true), + call_mode_1_sets_caller_to_parent_caller: Some(true), + scilla_messages_can_call_evm_contracts: Some(true), + adjust_contract_balance_on_deployment_if_contract_address_already_funded: Some( + true, + ), + }, + DeltaFork { + at_height: 100, + failed_scilla_call_from_gas_exempt_caller_causes_revert: None, + call_mode_1_sets_caller_to_parent_caller: Some(false), + scilla_messages_can_call_evm_contracts: None, + adjust_contract_balance_on_deployment_if_contract_address_already_funded: Some( + false, + ), + }, + DeltaFork { + at_height: 200, + failed_scilla_call_from_gas_exempt_caller_causes_revert: Some(false), + call_mode_1_sets_caller_to_parent_caller: None, + scilla_messages_can_call_evm_contracts: Some(false), + adjust_contract_balance_on_deployment_if_contract_address_already_funded: None, + }, + ]); + + let result = Forks::try_from(delta_forks).unwrap(); + assert_eq!(result.0.len(), 3); + + assert_eq!(result.0[0].at_height, 0); + assert_eq!( + result.0[0].failed_scilla_call_from_gas_exempt_caller_causes_revert, + true + ); + assert_eq!(result.0[0].call_mode_1_sets_caller_to_parent_caller, true); + assert_eq!(result.0[0].scilla_messages_can_call_evm_contracts, true); + assert_eq!( + result.0[0].adjust_contract_balance_on_deployment_if_contract_address_already_funded, + true + ); + + assert_eq!(result.0[1].at_height, 100); + assert_eq!( + result.0[1].failed_scilla_call_from_gas_exempt_caller_causes_revert, + true + ); + assert_eq!(result.0[1].call_mode_1_sets_caller_to_parent_caller, false); + assert_eq!(result.0[1].scilla_messages_can_call_evm_contracts, true); + assert_eq!( + result.0[1].adjust_contract_balance_on_deployment_if_contract_address_already_funded, + false + ); + + assert_eq!(result.0[2].at_height, 200); + assert_eq!( + result.0[2].failed_scilla_call_from_gas_exempt_caller_causes_revert, + false + ); + assert_eq!(result.0[2].call_mode_1_sets_caller_to_parent_caller, false); + assert_eq!(result.0[2].scilla_messages_can_call_evm_contracts, false); + assert_eq!( + result.0[2].adjust_contract_balance_on_deployment_if_contract_address_already_funded, + false + ); + } +} diff --git a/zilliqa/src/state.rs b/zilliqa/src/state.rs index 059efe9db..b2f8e242d 100644 --- a/zilliqa/src/state.rs +++ b/zilliqa/src/state.rs @@ -73,7 +73,7 @@ impl State { gas_price: *consensus_config.gas_price, scilla_call_gas_exempt_addrs: consensus_config.scilla_call_gas_exempt_addrs.clone(), chain_id: ChainId::new(config.eth_chain_id), - forks: consensus_config.forks.clone(), + forks: consensus_config.forks.clone().into(), block_store, } } From 6aa5f408308f199976f6cdec5885c06d915b3a99 Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Wed, 15 Jan 2025 18:11:25 +0330 Subject: [PATCH 04/11] fix z2 compilation --- z2/src/setup.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/z2/src/setup.rs b/z2/src/setup.rs index 79b735867..b23dd15c1 100644 --- a/z2/src/setup.rs +++ b/z2/src/setup.rs @@ -18,7 +18,7 @@ use tokio::fs; /// For now, it just generates secret keys (which should be different each run, or we will become dependent on their values) use zilliqa::{ api, - cfg::{max_rpc_response_size_default, state_cache_size_default, ApiServer}, + cfg::{max_rpc_response_size_default, state_cache_size_default, ApiServer, DeltaForks}, crypto::{SecretKey, TransactionPublicKey}, }; use zilliqa::{ @@ -28,7 +28,7 @@ use zilliqa::{ eth_chain_id_default, failed_request_sleep_duration_default, local_address_default, max_blocks_in_flight_default, scilla_address_default, scilla_ext_libs_path_default, scilla_stdlib_dir_default, state_rpc_limit_default, total_native_token_supply_default, - Amount, ConsensusConfig, ContractUpgradesBlockHeights, Forks, GenesisDeposit, + Amount, ConsensusConfig, ContractUpgradesBlockHeights, GenesisDeposit, }, transaction::EvmGas, }; @@ -537,7 +537,7 @@ impl Setup { total_native_token_supply: total_native_token_supply_default(), scilla_call_gas_exempt_addrs: vec![], contract_upgrade_block_heights: ContractUpgradesBlockHeights::default(), - forks: Forks::default(), + forks: DeltaForks::default(), }, block_request_limit: block_request_limit_default(), max_blocks_in_flight: max_blocks_in_flight_default(), From e805488a386c9fc78fae35e5f6aca6cdfb308f53 Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Wed, 15 Jan 2025 19:06:51 +0330 Subject: [PATCH 05/11] Fix tests --- zilliqa/tests/it/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zilliqa/tests/it/main.rs b/zilliqa/tests/it/main.rs index 9be342e59..940728534 100644 --- a/zilliqa/tests/it/main.rs +++ b/zilliqa/tests/it/main.rs @@ -351,7 +351,7 @@ impl Network { Address::new(get_contract_address(secret_key_to_address(&genesis_key).0, 2).0), ], contract_upgrade_block_heights, - forks: Forks::default(), + forks: DeltaForks::default(), }, api_servers: vec![ApiServer { port: 4201, @@ -489,7 +489,7 @@ impl Network { get_contract_address(secret_key_to_address(&self.genesis_key).0, 2).0, )], contract_upgrade_block_heights, - forks: Forks::default(), + forks: DeltaForks::default(), }, block_request_limit: block_request_limit_default(), max_blocks_in_flight: max_blocks_in_flight_default(), From 7cb820788c8b31aacce8b9e8d87b2e75b690c5a7 Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Thu, 16 Jan 2025 09:47:21 +0330 Subject: [PATCH 06/11] fix --- zilliqa/tests/it/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zilliqa/tests/it/main.rs b/zilliqa/tests/it/main.rs index 940728534..64803a48b 100644 --- a/zilliqa/tests/it/main.rs +++ b/zilliqa/tests/it/main.rs @@ -70,7 +70,7 @@ use zilliqa::{ max_blocks_in_flight_default, max_rpc_response_size_default, scilla_address_default, scilla_ext_libs_path_default, scilla_stdlib_dir_default, state_cache_size_default, state_rpc_limit_default, total_native_token_supply_default, Amount, ApiServer, Checkpoint, - ConsensusConfig, ContractUpgradesBlockHeights, Forks, GenesisDeposit, NodeConfig, + ConsensusConfig, ContractUpgradesBlockHeights, DeltaForks, GenesisDeposit, NodeConfig, }, crypto::{SecretKey, TransactionPublicKey}, db, From bdd54887453da5e43b4bb2ef6dce51a4804a75ea Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Thu, 16 Jan 2025 11:43:02 +0330 Subject: [PATCH 07/11] clippy --- zilliqa/src/cfg.rs | 47 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/zilliqa/src/cfg.rs b/zilliqa/src/cfg.rs index 62b85f8b5..b169a0694 100644 --- a/zilliqa/src/cfg.rs +++ b/zilliqa/src/cfg.rs @@ -653,10 +653,9 @@ mod tests { let result = Forks::try_from(delta_forks).unwrap(); assert_eq!(result.0.len(), 1); assert_eq!(result.0[0].at_height, 0); - assert_eq!(result.0[0].call_mode_1_sets_caller_to_parent_caller, false); - assert_eq!( - result.0[0].adjust_contract_balance_on_deployment_if_contract_address_already_funded, - false + assert!(!result.0[0].call_mode_1_sets_caller_to_parent_caller); + assert!( + !result.0[0].adjust_contract_balance_on_deployment_if_contract_address_already_funded, ); } @@ -694,39 +693,27 @@ mod tests { assert_eq!(result.0.len(), 3); assert_eq!(result.0[0].at_height, 0); - assert_eq!( - result.0[0].failed_scilla_call_from_gas_exempt_caller_causes_revert, - true - ); - assert_eq!(result.0[0].call_mode_1_sets_caller_to_parent_caller, true); - assert_eq!(result.0[0].scilla_messages_can_call_evm_contracts, true); - assert_eq!( + assert!(result.0[0].failed_scilla_call_from_gas_exempt_caller_causes_revert); + assert!(result.0[0].call_mode_1_sets_caller_to_parent_caller); + assert!(result.0[0].scilla_messages_can_call_evm_contracts); + assert!( result.0[0].adjust_contract_balance_on_deployment_if_contract_address_already_funded, - true ); assert_eq!(result.0[1].at_height, 100); - assert_eq!( - result.0[1].failed_scilla_call_from_gas_exempt_caller_causes_revert, - true - ); - assert_eq!(result.0[1].call_mode_1_sets_caller_to_parent_caller, false); - assert_eq!(result.0[1].scilla_messages_can_call_evm_contracts, true); - assert_eq!( - result.0[1].adjust_contract_balance_on_deployment_if_contract_address_already_funded, - false + assert!(result.0[1].failed_scilla_call_from_gas_exempt_caller_causes_revert,); + assert!(!result.0[1].call_mode_1_sets_caller_to_parent_caller); + assert!(result.0[1].scilla_messages_can_call_evm_contracts); + assert!( + !result.0[1].adjust_contract_balance_on_deployment_if_contract_address_already_funded ); assert_eq!(result.0[2].at_height, 200); - assert_eq!( - result.0[2].failed_scilla_call_from_gas_exempt_caller_causes_revert, - false - ); - assert_eq!(result.0[2].call_mode_1_sets_caller_to_parent_caller, false); - assert_eq!(result.0[2].scilla_messages_can_call_evm_contracts, false); - assert_eq!( - result.0[2].adjust_contract_balance_on_deployment_if_contract_address_already_funded, - false + assert!(!result.0[2].failed_scilla_call_from_gas_exempt_caller_causes_revert); + assert!(!result.0[2].call_mode_1_sets_caller_to_parent_caller); + assert!(!result.0[2].scilla_messages_can_call_evm_contracts); + assert!( + !result.0[2].adjust_contract_balance_on_deployment_if_contract_address_already_funded, ); } } From 2ecf6d82cf5f3cd7c439b4b8b3436f2d7950e54f Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Thu, 16 Jan 2025 12:06:24 +0330 Subject: [PATCH 08/11] clippy :( --- zilliqa/src/cfg.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zilliqa/src/cfg.rs b/zilliqa/src/cfg.rs index b169a0694..b0a06d429 100644 --- a/zilliqa/src/cfg.rs +++ b/zilliqa/src/cfg.rs @@ -650,7 +650,7 @@ mod tests { adjust_contract_balance_on_deployment_if_contract_address_already_funded: Some(false), }]); - let result = Forks::try_from(delta_forks).unwrap(); + let result = Forks::from(delta_forks); assert_eq!(result.0.len(), 1); assert_eq!(result.0[0].at_height, 0); assert!(!result.0[0].call_mode_1_sets_caller_to_parent_caller); @@ -689,7 +689,7 @@ mod tests { }, ]); - let result = Forks::try_from(delta_forks).unwrap(); + let result = Forks::from(delta_forks); assert_eq!(result.0.len(), 3); assert_eq!(result.0[0].at_height, 0); From 980b96416510d6bf72e925f9596ca5fa7a3e0079 Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Fri, 17 Jan 2025 13:23:15 +0330 Subject: [PATCH 09/11] fix code style --- zilliqa/src/cfg.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/zilliqa/src/cfg.rs b/zilliqa/src/cfg.rs index 188e7daf8..f961d3b88 100644 --- a/zilliqa/src/cfg.rs +++ b/zilliqa/src/cfg.rs @@ -527,7 +527,6 @@ pub struct DeltaFork { /// EOA (i.e. any ZIL passed will be transferred to the contract and execution will continue). If false, sending a /// Scilla message to an EVM contract will cause the Scilla transaction to fail. pub scilla_messages_can_call_evm_contracts: Option, - /// If true, when a contract is deployed, if the contract address is already funded, /// the contract balance will be sum of the existing balance and the amount sent in the deployment transaction. /// If false, the contract balance will be the amount sent in the deployment transaction. From 427725f1912c29e8c57cda19fded0707764509e3 Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Fri, 17 Jan 2025 13:29:05 +0330 Subject: [PATCH 10/11] bump solidity versions --- zilliqa/src/contracts/deposit_v1.sol | 2 +- zilliqa/src/contracts/deposit_v2.sol | 2 +- zilliqa/src/contracts/deposit_v3.sol | 2 +- zilliqa/src/contracts/deposit_v4.sol | 2 +- zilliqa/src/contracts/utils/deque.sol | 2 +- zilliqa/tests/it/contracts/CallMe.sol | 2 +- zilliqa/tests/it/contracts/CallingContract.sol | 2 +- zilliqa/tests/it/contracts/ContractCreatesAnotherContract.sol | 2 +- zilliqa/tests/it/contracts/EmitEvents.sol | 2 +- zilliqa/tests/it/contracts/LinkableShard.sol | 2 +- zilliqa/tests/it/contracts/RevertMe.sol | 2 +- zilliqa/tests/it/contracts/ScillaInterop.sol | 2 +- zilliqa/tests/it/contracts/SetGetContractValue.sol | 2 +- zilliqa/tests/it/contracts/Storage.sol | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zilliqa/src/contracts/deposit_v1.sol b/zilliqa/src/contracts/deposit_v1.sol index 9eec35e24..b7e96701c 100644 --- a/zilliqa/src/contracts/deposit_v1.sol +++ b/zilliqa/src/contracts/deposit_v1.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {Deque} from "./utils/deque.sol"; diff --git a/zilliqa/src/contracts/deposit_v2.sol b/zilliqa/src/contracts/deposit_v2.sol index f747fb2af..d3a2feced 100644 --- a/zilliqa/src/contracts/deposit_v2.sol +++ b/zilliqa/src/contracts/deposit_v2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {Deque, Withdrawal} from "./utils/deque.sol"; diff --git a/zilliqa/src/contracts/deposit_v3.sol b/zilliqa/src/contracts/deposit_v3.sol index 0fa429d1b..7286c30d7 100644 --- a/zilliqa/src/contracts/deposit_v3.sol +++ b/zilliqa/src/contracts/deposit_v3.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {Deque, Withdrawal} from "./utils/deque.sol"; diff --git a/zilliqa/src/contracts/deposit_v4.sol b/zilliqa/src/contracts/deposit_v4.sol index fa250ba09..77d6bb94a 100644 --- a/zilliqa/src/contracts/deposit_v4.sol +++ b/zilliqa/src/contracts/deposit_v4.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {Deque, Withdrawal} from "./utils/deque.sol"; diff --git a/zilliqa/src/contracts/utils/deque.sol b/zilliqa/src/contracts/utils/deque.sol index 0582928eb..19de3022f 100644 --- a/zilliqa/src/contracts/utils/deque.sol +++ b/zilliqa/src/contracts/utils/deque.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; struct Withdrawal { uint256 startedAt; diff --git a/zilliqa/tests/it/contracts/CallMe.sol b/zilliqa/tests/it/contracts/CallMe.sol index daed89f20..eacba1316 100644 --- a/zilliqa/tests/it/contracts/CallMe.sol +++ b/zilliqa/tests/it/contracts/CallMe.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; contract CallMe { constructor() {} diff --git a/zilliqa/tests/it/contracts/CallingContract.sol b/zilliqa/tests/it/contracts/CallingContract.sol index ecb8c372b..0a0c6db35 100644 --- a/zilliqa/tests/it/contracts/CallingContract.sol +++ b/zilliqa/tests/it/contracts/CallingContract.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // Source: https://solidity-by-example.org/calling-contract/ -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; contract Callee { uint256 public x; diff --git a/zilliqa/tests/it/contracts/ContractCreatesAnotherContract.sol b/zilliqa/tests/it/contracts/ContractCreatesAnotherContract.sol index 3166cfd6e..1ed856bb6 100644 --- a/zilliqa/tests/it/contracts/ContractCreatesAnotherContract.sol +++ b/zilliqa/tests/it/contracts/ContractCreatesAnotherContract.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; contract Creator { event Created(CreateMe createMe); diff --git a/zilliqa/tests/it/contracts/EmitEvents.sol b/zilliqa/tests/it/contracts/EmitEvents.sol index f6f532c5b..3f06749e9 100644 --- a/zilliqa/tests/it/contracts/EmitEvents.sol +++ b/zilliqa/tests/it/contracts/EmitEvents.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; contract EmitEvents { // Two random events from common tokens. diff --git a/zilliqa/tests/it/contracts/LinkableShard.sol b/zilliqa/tests/it/contracts/LinkableShard.sol index 7bb8e1301..e96f3b1bb 100644 --- a/zilliqa/tests/it/contracts/LinkableShard.sol +++ b/zilliqa/tests/it/contracts/LinkableShard.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import "../../../src/contracts/shard.sol"; import "../../../src/contracts/shard_registry.sol"; diff --git a/zilliqa/tests/it/contracts/RevertMe.sol b/zilliqa/tests/it/contracts/RevertMe.sol index 628f03767..0ec01c19f 100644 --- a/zilliqa/tests/it/contracts/RevertMe.sol +++ b/zilliqa/tests/it/contracts/RevertMe.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; contract RevertMe { int256 public value = 0; diff --git a/zilliqa/tests/it/contracts/ScillaInterop.sol b/zilliqa/tests/it/contracts/ScillaInterop.sol index 5c4707d77..99178525c 100644 --- a/zilliqa/tests/it/contracts/ScillaInterop.sol +++ b/zilliqa/tests/it/contracts/ScillaInterop.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; // Source: https://github.com/Zilliqa/zilliqa-developer/blob/main/contracts/experimental/ERC20ProxyForZRC2/contracts/ScillaConnector.sol library ScillaConnector { diff --git a/zilliqa/tests/it/contracts/SetGetContractValue.sol b/zilliqa/tests/it/contracts/SetGetContractValue.sol index ef75e17fc..7839013ea 100644 --- a/zilliqa/tests/it/contracts/SetGetContractValue.sol +++ b/zilliqa/tests/it/contracts/SetGetContractValue.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; contract SetGetContractValue { uint256 private value = 99; diff --git a/zilliqa/tests/it/contracts/Storage.sol b/zilliqa/tests/it/contracts/Storage.sol index 8bdd14b6d..846215e29 100644 --- a/zilliqa/tests/it/contracts/Storage.sol +++ b/zilliqa/tests/it/contracts/Storage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; contract Storage { uint pos0; mapping(address => uint) public pos1; From d7eed577d63dc3ec4f06ea597116480d6826ed7c Mon Sep 17 00:00:00 2001 From: saeed-zil Date: Fri, 17 Jan 2025 13:35:58 +0330 Subject: [PATCH 11/11] bump solidity versions --- zilliqa/src/contracts/intershard_bridge.sol | 2 +- zilliqa/src/contracts/shard.sol | 2 +- zilliqa/src/contracts/shard_registry.sol | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zilliqa/src/contracts/intershard_bridge.sol b/zilliqa/src/contracts/intershard_bridge.sol index 177aa0932..097592661 100644 --- a/zilliqa/src/contracts/intershard_bridge.sol +++ b/zilliqa/src/contracts/intershard_bridge.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.4; +pragma solidity ^0.8.24; contract IntershardBridge { event Relayed( diff --git a/zilliqa/src/contracts/shard.sol b/zilliqa/src/contracts/shard.sol index 32f3e0f47..0fff05bb1 100644 --- a/zilliqa/src/contracts/shard.sol +++ b/zilliqa/src/contracts/shard.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.4; +pragma solidity ^0.8.24; contract Shard { event ValidatorAdded(address validator); diff --git a/zilliqa/src/contracts/shard_registry.sol b/zilliqa/src/contracts/shard_registry.sol index 72bd7102c..52ececaf6 100644 --- a/zilliqa/src/contracts/shard_registry.sol +++ b/zilliqa/src/contracts/shard_registry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -pragma solidity ^0.8.4; +pragma solidity ^0.8.24; import {Shard} from "./shard.sol";