Skip to content

Commit

Permalink
update: upgrade @OpenZeppelin contract packages to latest 5.0.0 versi…
Browse files Browse the repository at this point in the history
…on (#536) (#541)

* update(docs): upgraded OZ packages to latest version 5.0.0

Signed-off-by: Logan Nguyen <[email protected]>

* update: removed ERC20SnapshotMock contract

Signed-off-by: Logan Nguyen <[email protected]>

* update: replaced OZ/SafeMath.sol to OZ/Math.sol

Signed-off-by: Logan Nguyen <[email protected]>

* fix: replaced _getImplementation() with ERC1967Utils.getImplementation();

Signed-off-by: Logan Nguyen <[email protected]>

* fix: passed arguments to the new Ownable base constructor

Signed-off-by: Logan Nguyen <[email protected]>

* fix: fixed warnings

Signed-off-by: Logan Nguyen <[email protected]>

* update: re-compiled all contracts

Signed-off-by: Logan Nguyen <[email protected]>

* update: replaced _isApprovedOrOwner with new _isAuthorized override

Signed-off-by: Logan Nguyen <[email protected]>

* update: removed ERC20Snapshot in unit tests

Signed-off-by: Logan Nguyen <[email protected]>

* update: removed safeTransferFrom(address, address, uint256)

As OZ/contract v5.0.0 only allow override safeTransferFrom(address,address,uint256,bytes), safeTransaferFrom(address,address,uint256) will cause error `Trying to override non-virtual function.`

Signed-off-by: Logan Nguyen <[email protected]>

* update: add more to RETRY_DELAY

Signed-off-by: Logan Nguyen <[email protected]>

* feat: added OZUUPSUpgradeableV4 to bypass `safeUpgrade`  checks

Signed-off-by: Logan Nguyen <[email protected]>

* update: re-compiled all contracts

Signed-off-by: Logan Nguyen <[email protected]>

* feat: added OZUUPSUpgradeableV4 to bypass `safeUpgrade`  checks

Signed-off-by: Logan Nguyen <[email protected]>

* update: recompiled contracts that utilized OZUUPSUpgradeableV4

Signed-off-by: Logan Nguyen <[email protected]>

* update: updated license

Signed-off-by: Logan Nguyen <[email protected]>

* update: restored destroyContract()

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: Logan Nguyen <[email protected]>
  • Loading branch information
quiet-node authored Nov 3, 2023
1 parent e0413d3 commit 271fa2e
Show file tree
Hide file tree
Showing 64 changed files with 1,466 additions and 942 deletions.
4 changes: 2 additions & 2 deletions artifacts/contracts/diamond-pattern/Diamond.sol/Diamond.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "function"
}
],
"bytecode": "0x608060405234801561000f575f80fd5b506101458061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063e1c7392a1461002d575b5f80fd5b61010d7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f6020527f699d9daa71b280d05a152715774afa0a81a312594b2d731d6b0b2552b7d6f69f8054600160ff1991821681179092557ff97e938d8af42f52387bb74b8b526fda8f184cc2aa534340a8d75a88fbecc77580548216831790557f65d510a5d8f7ef134ec444f7f34ee808c8eeb5177cdfd16be0c40fe1ab43369580548216831790556307f5828d60e41b5f527f5622121b47b8cd0120c4efe45dd5483242f54a3d49bd7679be565d47694918c380549091169091179055565b00fea2646970667358221220c0ba3d803292c8acaed3cc8adea986c753dd92e96a1b10ac3e1ba8b352d9e20e64736f6c63430008140033",
"deployedBytecode": "0x608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063e1c7392a1461002d575b5f80fd5b61010d7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f6020527f699d9daa71b280d05a152715774afa0a81a312594b2d731d6b0b2552b7d6f69f8054600160ff1991821681179092557ff97e938d8af42f52387bb74b8b526fda8f184cc2aa534340a8d75a88fbecc77580548216831790557f65d510a5d8f7ef134ec444f7f34ee808c8eeb5177cdfd16be0c40fe1ab43369580548216831790556307f5828d60e41b5f527f5622121b47b8cd0120c4efe45dd5483242f54a3d49bd7679be565d47694918c380549091169091179055565b00fea2646970667358221220c0ba3d803292c8acaed3cc8adea986c753dd92e96a1b10ac3e1ba8b352d9e20e64736f6c63430008140033",
"bytecode": "0x608060405234801561001057600080fd5b50610149806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063e1c7392a14610030575b600080fd5b6101117fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f6020527f699d9daa71b280d05a152715774afa0a81a312594b2d731d6b0b2552b7d6f69f8054600160ff1991821681179092557ff97e938d8af42f52387bb74b8b526fda8f184cc2aa534340a8d75a88fbecc77580548216831790557f65d510a5d8f7ef134ec444f7f34ee808c8eeb5177cdfd16be0c40fe1ab43369580548216831790556307f5828d60e41b6000527f5622121b47b8cd0120c4efe45dd5483242f54a3d49bd7679be565d47694918c380549091169091179055565b00fea2646970667358221220a7d901a5eeed94cc41fb69deb0b9ec809861c3f0ac9505bf32ac9424dca5fd6264736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063e1c7392a14610030575b600080fd5b6101117fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f6020527f699d9daa71b280d05a152715774afa0a81a312594b2d731d6b0b2552b7d6f69f8054600160ff1991821681179092557ff97e938d8af42f52387bb74b8b526fda8f184cc2aa534340a8d75a88fbecc77580548216831790557f65d510a5d8f7ef134ec444f7f34ee808c8eeb5177cdfd16be0c40fe1ab43369580548216831790556307f5828d60e41b6000527f5622121b47b8cd0120c4efe45dd5483242f54a3d49bd7679be565d47694918c380549091169091179055565b00fea2646970667358221220a7d901a5eeed94cc41fb69deb0b9ec809861c3f0ac9505bf32ac9424dca5fd6264736f6c63430008140033",
"linkReferences": {},
"deployedLinkReferences": {}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
"type": "function"
}
],
"bytecode": "0x608060405234801561000f575f80fd5b5061068d8061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610055575f3560e01c806301ffc9a71461005957806352ef6b2c146100b95780637a0ed627146100ce578063adfca15e146100e3578063cdffacc614610103575b5f80fd5b6100a461006736600461049b565b6001600160e01b0319165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100c161016c565b6040516100b091906104c9565b6100d66101ee565b6040516100b09190610558565b6100f66100f13660046105d3565b6103c1565b6040516100b091906105f9565b61015461011136600461049b565b6001600160e01b0319165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020016100b0565b60605f7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600281018054604080516020808402820181019092528281529394508301828280156101e357602002820191905f5260205f20905b81546001600160a01b031681526001909101906020018083116101c5575b505050505091505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c908067ffffffffffffffff81111561024e5761024e61060b565b60405190808252806020026020018201604052801561029357816020015b604080518082019091525f81526060602082015281526020019060019003908161026c5790505b5092505f5b818110156103bb575f8360020182815481106102b6576102b661061f565b905f5260205f20015f9054906101000a90046001600160a01b03169050808583815181106102e6576102e661061f565b6020908102919091018101516001600160a01b0392831690529082165f9081526001860182526040908190208054825181850281018501909352808352919290919083018282801561038157602002820191905f5260205f20905f905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116103435790505b50505050508583815181106103985761039861061f565b6020026020010151602001819052505080806103b390610633565b915050610298565b50505090565b6001600160a01b0381165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602090815260409182902080548351818402810184019094528084526060937fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092919083018282801561048e57602002820191905f5260205f20905f905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116104505790505b5050505050915050919050565b5f602082840312156104ab575f80fd5b81356001600160e01b0319811681146104c2575f80fd5b9392505050565b602080825282518282018190525f9190848201906040850190845b818110156105095783516001600160a01b0316835292840192918401916001016104e4565b50909695505050505050565b5f8151808452602080850194508084015f5b8381101561054d5781516001600160e01b03191687529582019590820190600101610527565b509495945050505050565b5f6020808301818452808551808352604092508286019150828160051b8701018488015f5b838110156105c557888303603f19018552815180516001600160a01b031684528701518784018790526105b287850182610515565b958801959350509086019060010161057d565b509098975050505050505050565b5f602082840312156105e3575f80fd5b81356001600160a01b03811681146104c2575f80fd5b602081525f6104c26020830184610515565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f6001820161065057634e487b7160e01b5f52601160045260245ffd5b506001019056fea2646970667358221220e7d657a85a9541350556d62f4573ee30aad189b91698aa34f24942caae70990b64736f6c63430008140033",
"deployedBytecode": "0x608060405234801561000f575f80fd5b5060043610610055575f3560e01c806301ffc9a71461005957806352ef6b2c146100b95780637a0ed627146100ce578063adfca15e146100e3578063cdffacc614610103575b5f80fd5b6100a461006736600461049b565b6001600160e01b0319165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100c161016c565b6040516100b091906104c9565b6100d66101ee565b6040516100b09190610558565b6100f66100f13660046105d3565b6103c1565b6040516100b091906105f9565b61015461011136600461049b565b6001600160e01b0319165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020016100b0565b60605f7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600281018054604080516020808402820181019092528281529394508301828280156101e357602002820191905f5260205f20905b81546001600160a01b031681526001909101906020018083116101c5575b505050505091505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c908067ffffffffffffffff81111561024e5761024e61060b565b60405190808252806020026020018201604052801561029357816020015b604080518082019091525f81526060602082015281526020019060019003908161026c5790505b5092505f5b818110156103bb575f8360020182815481106102b6576102b661061f565b905f5260205f20015f9054906101000a90046001600160a01b03169050808583815181106102e6576102e661061f565b6020908102919091018101516001600160a01b0392831690529082165f9081526001860182526040908190208054825181850281018501909352808352919290919083018282801561038157602002820191905f5260205f20905f905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116103435790505b50505050508583815181106103985761039861061f565b6020026020010151602001819052505080806103b390610633565b915050610298565b50505090565b6001600160a01b0381165f9081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602090815260409182902080548351818402810184019094528084526060937fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092919083018282801561048e57602002820191905f5260205f20905f905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116104505790505b5050505050915050919050565b5f602082840312156104ab575f80fd5b81356001600160e01b0319811681146104c2575f80fd5b9392505050565b602080825282518282018190525f9190848201906040850190845b818110156105095783516001600160a01b0316835292840192918401916001016104e4565b50909695505050505050565b5f8151808452602080850194508084015f5b8381101561054d5781516001600160e01b03191687529582019590820190600101610527565b509495945050505050565b5f6020808301818452808551808352604092508286019150828160051b8701018488015f5b838110156105c557888303603f19018552815180516001600160a01b031684528701518784018790526105b287850182610515565b958801959350509086019060010161057d565b509098975050505050505050565b5f602082840312156105e3575f80fd5b81356001600160a01b03811681146104c2575f80fd5b602081525f6104c26020830184610515565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f6001820161065057634e487b7160e01b5f52601160045260245ffd5b506001019056fea2646970667358221220e7d657a85a9541350556d62f4573ee30aad189b91698aa34f24942caae70990b64736f6c63430008140033",
"bytecode": "0x608060405234801561001057600080fd5b506106b6806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806301ffc9a71461005c57806352ef6b2c146100bd5780637a0ed627146100d2578063adfca15e146100e7578063cdffacc614610107575b600080fd5b6100a861006a3660046104b1565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100c5610171565b6040516100b491906104e2565b6100da6101f6565b6040516100b49190610574565b6100fa6100f53660046105f1565b6103d3565b6040516100b4919061061a565b6101596101153660046104b1565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020016100b4565b606060007fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600281018054604080516020808402820181019092528281529394508301828280156101eb57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116101cd575b505050505091505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c908067ffffffffffffffff8111156102565761025661062d565b60405190808252806020026020018201604052801561029c57816020015b6040805180820190915260008152606060208201528152602001906001900390816102745790505b50925060005b818110156103cd5760008360020182815481106102c1576102c1610643565b9060005260206000200160009054906101000a90046001600160a01b03169050808583815181106102f4576102f4610643565b6020908102919091018101516001600160a01b03928316905290821660009081526001860182526040908190208054825181850281018501909352808352919290919083018282801561039357602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116103555790505b50505050508583815181106103aa576103aa610643565b6020026020010151602001819052505080806103c590610659565b9150506102a2565b50505090565b6001600160a01b03811660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602090815260409182902080548351818402810184019094528084526060937fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c93909291908301828280156104a457602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116104665790505b5050505050915050919050565b6000602082840312156104c357600080fd5b81356001600160e01b0319811681146104db57600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156105235783516001600160a01b0316835292840192918401916001016104fe565b50909695505050505050565b600081518084526020808501945080840160005b838110156105695781516001600160e01b03191687529582019590820190600101610543565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156105e357888303603f19018552815180516001600160a01b031684528701518784018790526105d08785018261052f565b958801959350509086019060010161059b565b509098975050505050505050565b60006020828403121561060357600080fd5b81356001600160a01b03811681146104db57600080fd5b6020815260006104db602083018461052f565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161067957634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220bf9fb73e021c54bec365884503678cb2fcde1afe8eb2a0ea2d5d81783300f8c264736f6c63430008140033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c806301ffc9a71461005c57806352ef6b2c146100bd5780637a0ed627146100d2578063adfca15e146100e7578063cdffacc614610107575b600080fd5b6100a861006a3660046104b1565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100c5610171565b6040516100b491906104e2565b6100da6101f6565b6040516100b49190610574565b6100fa6100f53660046105f1565b6103d3565b6040516100b4919061061a565b6101596101153660046104b1565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020016100b4565b606060007fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600281018054604080516020808402820181019092528281529394508301828280156101eb57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116101cd575b505050505091505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c908067ffffffffffffffff8111156102565761025661062d565b60405190808252806020026020018201604052801561029c57816020015b6040805180820190915260008152606060208201528152602001906001900390816102745790505b50925060005b818110156103cd5760008360020182815481106102c1576102c1610643565b9060005260206000200160009054906101000a90046001600160a01b03169050808583815181106102f4576102f4610643565b6020908102919091018101516001600160a01b03928316905290821660009081526001860182526040908190208054825181850281018501909352808352919290919083018282801561039357602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116103555790505b50505050508583815181106103aa576103aa610643565b6020026020010151602001819052505080806103c590610659565b9150506102a2565b50505090565b6001600160a01b03811660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602090815260409182902080548351818402810184019094528084526060937fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c93909291908301828280156104a457602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b031916815260200190600401906020826003010492830192600103820291508084116104665790505b5050505050915050919050565b6000602082840312156104c357600080fd5b81356001600160e01b0319811681146104db57600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156105235783516001600160a01b0316835292840192918401916001016104fe565b50909695505050505050565b600081518084526020808501945080840160005b838110156105695781516001600160e01b03191687529582019590820190600101610543565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156105e357888303603f19018552815180516001600160a01b031684528701518784018790526105d08785018261052f565b958801959350509086019060010161059b565b509098975050505050505050565b60006020828403121561060357600080fd5b81356001600160a01b03811681146104db57600080fd5b6020815260006104db602083018461052f565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161067957634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220bf9fb73e021c54bec365884503678cb2fcde1afe8eb2a0ea2d5d81783300f8c264736f6c63430008140033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Loading

0 comments on commit 271fa2e

Please sign in to comment.