Skip to content

Commit 091f4f6

Browse files
committed
allow upgrades many times
1 parent ea5cfa8 commit 091f4f6

File tree

1 file changed

+1
-6
lines changed
  • antelope_contracts/contracts/erc20/src

1 file changed

+1
-6
lines changed

antelope_contracts/contracts/erc20/src/erc20.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <silkworm/core/execution/address.hpp>
1111
#include <silkworm/core/common/util.hpp>
1212

13-
// avoid solidity compiler generating emtpy bytecodes
13+
// avoid solidity compiler generating empty bytecode
1414
static_assert(sizeof(solidity::erc20::bytecode) >= 16);
1515
static_assert(sizeof(solidity::proxy::bytecode) >= 16);
1616
static_assert(sizeof(solidity::evm2native::bytecode) >= 16);
@@ -106,9 +106,7 @@ uint64_t erc20::get_next_nonce() {
106106
void erc20::upgrade() {
107107
require_auth(get_self());
108108

109-
uint64_t id = 0;
110109
impl_contract_table_t contract_table(_self, _self.value);
111-
check(contract_table.find(id) == contract_table.end(), "implementation contract already deployed");
112110

113111
bytes call_data;
114112

@@ -141,7 +139,6 @@ void erc20::upgradeto(std::string impl_address) {
141139
eosio::check(!!address_bytes, "implementation address must be valid 0x EVM address");
142140
eosio::check(address_bytes->size() == kAddressLength, "invalid length of implementation address");
143141

144-
uint64_t id = 0;
145142
impl_contract_table_t contract_table(_self, _self.value);
146143

147144
contract_table.emplace(_self, [&](auto &v) {
@@ -154,9 +151,7 @@ void erc20::upgradeto(std::string impl_address) {
154151
void erc20::upgdevm2nat() {
155152
require_auth(get_self());
156153

157-
uint64_t id = 0;
158154
evm2native_impl_table_t contract_table(_self, _self.value);
159-
check(contract_table.find(id) == contract_table.end(), "evm2native implementation contract already deployed");
160155

161156
bytes call_data;
162157

0 commit comments

Comments
 (0)