diff --git a/contracts/oasys/deployments.go b/contracts/oasys/deployments.go index 326c39cea..2256f101c 100644 --- a/contracts/oasys/deployments.go +++ b/contracts/oasys/deployments.go @@ -22,7 +22,7 @@ var deploymentSets = map[common.Hash]map[uint64]deploymentSet{ 1892000: deploymentSet{deployments10}, 4089588: deploymentSet{deployments11}, 5095900: deploymentSet{deployments12}, - 5498661: deploymentSet{deployments13}, + 5527429: deploymentSet{deployments13}, }, params.OasysTestnetGenesisHash: { 1: deploymentSet{deployments0}, diff --git a/contracts/oasys/oasys_test.go b/contracts/oasys/oasys_test.go index fa49fe1a8..4766b953c 100644 --- a/contracts/oasys/oasys_test.go +++ b/contracts/oasys/oasys_test.go @@ -1184,7 +1184,7 @@ func TestDeploy(t *testing.T) { {1892000, []deployFn{_deployments10}}, {4089588, []deployFn{_deployments11}}, {5095900, []deployFn{_deployments12}}, - {5498661, []deployFn{_deployments13}}, + {5527429, []deployFn{_deployments13}}, }, }, { diff --git a/core/vm/evm.go b/core/vm/evm.go index c84fc1ee7..40dc58cb3 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -178,7 +178,9 @@ func (evm *EVM) Interpreter() *EVMInterpreter { // execution error or failed value transfer. func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas uint64, value *uint256.Int) (ret []byte, leftOverGas uint64, err error) { // Fail if the address is not allowed to call - if IsDeniedToCall(evm.StateDB, addr) { + // Skip the check if this call is readonly (eth_call) + readOnly := evm.Config.NoBaseFee + if !readOnly && IsDeniedToCall(evm.StateDB, addr) { return nil, 0, ErrUnauthorizedCall } // Fail if we're trying to execute above the call depth limit @@ -441,7 +443,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, // because this check targets raw transactions from EOA, and `CREATE2` // within internal transactions is excluded. // Need to check after nonce increment to evict failed tx from the pool. - if typ == CREATE && !IsAllowedToCreate(evm.StateDB, caller.Address()) { + if evm.depth == 0 && typ == CREATE && !IsAllowedToCreate(evm.StateDB, caller.Address()) { return nil, common.Address{}, 0, ErrUnauthorizedCreate } // We add this to the access list _before_ taking a snapshot. Even if the creation fails, diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index b9f6f4dec..02bf5547b 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1253,6 +1253,11 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr if err != nil { return 0, err } + // Fail if the address is not allowed to call + to := args.To + if to != nil && vm.IsDeniedToCall(state, *to) { + return 0, fmt.Errorf("the calling contract is in denlylist. to: %s", to.Hex()) + } estimate, revert, err := gasestimator.Estimate(ctx, call, opts, gasCap) if err != nil { if len(revert) > 0 { @@ -1867,7 +1872,7 @@ func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c } // Fail if the address is not allowed to call if to != nil && vm.IsDeniedToCall(state, *to) { - return common.Hash{}, fmt.Errorf("the calling contract is in denlylist. to: %s", to) + return common.Hash{}, fmt.Errorf("the calling contract is in denlylist. to: %s", to.Hex()) } if err := b.SendTx(ctx, tx); err != nil { diff --git a/params/config.go b/params/config.go index 48add7b27..24ced540b 100644 --- a/params/config.go +++ b/params/config.go @@ -234,7 +234,7 @@ var ( BerlinBlock: big.NewInt(0), LondonBlock: big.NewInt(0), ShanghaiTime: newUint64(1721910600), // Thu Jul 25 2024 21:30:00 GMT+0900 - CancunTime: newUint64(1734336000), // Mon Dec 16 2024 17:00:00 GMT+0900 + CancunTime: newUint64(1734508800), // Wed Dec 18 2024 17:00:00 GMT+0900 Oasys: &OasysConfig{ Period: 15, diff --git a/params/version.go b/params/version.go index e43013863..b8362a574 100644 --- a/params/version.go +++ b/params/version.go @@ -23,7 +23,7 @@ import ( const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 7 // Minor version component of the current release - VersionPatch = 1 // Patch version component of the current release + VersionPatch = 2 // Patch version component of the current release VersionMeta = "testnet0" // Version metadata to append to the version string )