-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(levm): create to an existing address (#1523)
**Motivation** The `CREATE` transaction logic did not handle the case where the address where we the contract will be deploy already exists. **Description** - Add a check in `VM::new()` where the transaction is `CREATE`. If `new_contract_address` exists in the db and it has nonce or bytecode, we don't create the new account and we don't add it in the cache. We know this is an error and the revert will be handled in `transact()` - Something similar in `transact()`, we check if the transaction is `CREATE` and if `new_address_acc` has code or nonce. In that case we return a `TransactionReport` with `TxResult::Revert`. - Support the creation of a contract even if the account has balance. Related #1517 --------- Co-authored-by: Tomas Fabrizio Orsi <[email protected]> Co-authored-by: Jeremías Salomón <[email protected]> Co-authored-by: JereSalo <[email protected]>
- Loading branch information
1 parent
55d3c7c
commit fac0f14
Showing
2 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters