Skip to content

Commit

Permalink
[SMART-12] feat(EVM): enabling smart accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
eyqs committed Aug 5, 2024
1 parent 48de203 commit 1cf6e6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,13 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
// Initialise a new contract and set the code that is to be used by the EVM.
// The contract is a scoped environment for this execution context only.
code := evm.StateDB.GetCode(addr)
if len(code) == 0 {
if len(code) == 0 && !evm.StateDB.Exist(addr) {
ret, err = nil, nil // gas is unchanged
} else {
// If it's an EOA, we load the code from the Plume Gateway
if len(code) == 0 && evm.StateDB.Exist(addr) {
code = evm.StateDB.GetCode(common.HexToAddress("0x0000000000000000000000000000000000001337"))
}
addrCopy := addr
// If the account has no code, we can abort here
// The depth-check is already done, and precompiles handled above
Expand Down

0 comments on commit 1cf6e6f

Please sign in to comment.