Skip to content

Commit

Permalink
Chore: Update js dependencies (#543)
Browse files Browse the repository at this point in the history
A number of the JS dependencies were out of date and require to be updated. While a number of these were used almost exclusively for testing, the EVM ERC 20 contract is obviously used in production. Over the last year, we had carefully monitored to ensure that we have not been allowing security-related vulnerabilities into our production contracts. However updating these contracts is a good thing to do, and should be actively updated going forward as we do see slight performance gains in doing so.

As a small bonus, this also introduces a force of updating the docker image used to compile some of the test / benchmark contracts.

There are no known related issues.

The EvmErc20 and EvmErc20V2 contracts have been recompiled due to the nature of these changes as the compiler has been updated. However, this is expected and intended.

None are required.
  • Loading branch information
joshuajbouw committed Aug 18, 2022
1 parent 55df39c commit 11c8c29
Show file tree
Hide file tree
Showing 9 changed files with 1,644 additions and 1,028 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ testnet-debug.wasm: target/wasm32-unknown-unknown/debug/aurora_engine.wasm
# test builds depend on release since `tests/test_upgrade.rs` includes `mainnet-release.wasm`

test-mainnet: mainnet-test-build
$(CARGO) test --features mainnet-test$(ADDITIONAL_FEATURES)
$(CARGO) test --features mainnet-test$(ADDITIONAL_FEATURES) -- --nocapture
mainnet-test-build: FEATURES=mainnet,integration-test,meta-call
mainnet-test-build: mainnet-test.wasm
mainnet-test.wasm: target/wasm32-unknown-unknown/release/aurora_engine.wasm
Expand All @@ -57,7 +57,7 @@ testnet-test-build: testnet-test.wasm
testnet-test.wasm: target/wasm32-unknown-unknown/release/aurora_engine.wasm
cp $< $@

target/wasm32-unknown-unknown/release/aurora_engine.wasm: Cargo.toml Cargo.lock $(shell find src -name "*.rs") etc/eth-contracts/res/EvmErc20.bin
target/wasm32-unknown-unknown/release/aurora_engine.wasm: Cargo.toml Cargo.lock $(shell find engine -name "*.rs") etc/eth-contracts/res/EvmErc20.bin
RUSTFLAGS='-C link-arg=-s' $(CARGO) build \
--target wasm32-unknown-unknown \
--release \
Expand All @@ -67,7 +67,7 @@ target/wasm32-unknown-unknown/release/aurora_engine.wasm: Cargo.toml Cargo.lock
--features=$(FEATURES)$(ADDITIONAL_FEATURES) \
-Z avoid-dev-deps

target/wasm32-unknown-unknown/debug/aurora_engine.wasm: Cargo.toml Cargo.lock $(wildcard src/*.rs) etc/eth-contracts/res/EvmErc20.bin
target/wasm32-unknown-unknown/debug/aurora_engine.wasm: Cargo.toml Cargo.lock $(wildcard engine/*.rs) etc/eth-contracts/res/EvmErc20.bin
$(CARGO) build \
--target wasm32-unknown-unknown \
-p aurora-engine \
Expand Down
6 changes: 4 additions & 2 deletions engine-tests/src/test_utils/solidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ where
])
.output()
.unwrap();
println!("{}", String::from_utf8(output.stdout).unwrap());
if !output.status.success() {
panic!("{}", String::from_utf8(output.stderr).unwrap());
panic!(
"Could not compile solidity contracts in docker: {}",
String::from_utf8(output.stderr).unwrap()
);
}
}
2 changes: 1 addition & 1 deletion etc/eth-contracts/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require('./tasks/storage');
module.exports = {
newStorageLayoutPath: './storageLayout',
solidity: {
version: '0.8.3',
version: '0.8.15',
settings: {
optimizer: {
enabled: true,
Expand Down
37 changes: 19 additions & 18 deletions etc/eth-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@
"version": "0.1.0",
"description": "ERC20 token implementation on EVM mapped from Native NEP-141",
"dependencies": {
"@openzeppelin/contracts": "^4.3.3"
"@openzeppelin/contracts": "^4.7.0"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.1",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@nomiclabs/hardhat-ethers": "^2.0.6",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"hardhat-storage-layout": "^0.1.6",
"chai": "^4.3.3",
"eslint": "^6.3.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"eth-gas-reporter": "^0.2.11",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.0.31",
"hardhat": "^2.1.1",
"rainbow-bridge-lib": "^2.0.0",
"solc": "0.8.3",
"solidity-coverage": "^0.7.16",
"solium": "^1.2.5"
"chai": "^4.3.6",
"eslint": "^8.18.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-promise": "^6.0.0",
"eth-gas-reporter": "^0.2.25",
"ethereum-waffle": "^3.4.4",
"ethers": "^5.6.9",
"hardhat": "^2.9.9",
"rainbow-bridge-lib": "^3.0.0",
"solc": "0.8.15",
"solidity-coverage": "^0.7.21",
"solium": "^1.2.5",
"typescript": ">=3.7.0"
},
"scripts": {
"compile": "hardhat compile",
Expand Down
Binary file added etc/eth-contracts/res/EvmErc20.bin
Binary file not shown.
1 change: 1 addition & 0 deletions etc/eth-contracts/res/EvmErc20.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x60806040523480156200001157600080fd5b506040516200181a3803806200181a833981016040819052620000349162000186565b80600085856003620000478382620002b9565b506004620000568282620002b9565b5050600580546001600160a01b0319166001600160a01b0394909416939093179092556006555060076200008b8582620002b9565b5060086200009a8482620002b9565b50506009805460ff191660ff9290921691909117905550620003859050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620000e157600080fd5b81516001600160401b0380821115620000fe57620000fe620000b9565b604051601f8301601f19908116603f01168101908282118183101715620001295762000129620000b9565b816040528381526020925086838588010111156200014657600080fd5b600091505b838210156200016a57858201830151818301840152908201906200014b565b838211156200017c5760008385830101525b9695505050505050565b600080600080608085870312156200019d57600080fd5b84516001600160401b0380821115620001b557600080fd5b620001c388838901620000cf565b95506020870151915080821115620001da57600080fd5b50620001e987828801620000cf565b935050604085015160ff811681146200020157600080fd5b60608601519092506001600160a01b03811681146200021f57600080fd5b939692955090935050565b600181811c908216806200023f57607f821691505b6020821081036200026057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002b457600081815260208120601f850160051c810160208610156200028f5750805b601f850160051c820191505b81811015620002b0578281556001016200029b565b5050505b505050565b81516001600160401b03811115620002d557620002d5620000b9565b620002ed81620002e684546200022a565b8462000266565b602080601f8311600181146200032557600084156200030c5750858301515b600019600386901b1c1916600185901b178555620002b0565b600085815260208120601f198616915b82811015620003565788860151825594840194600190910190840162000335565b5085821015620003755787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61148580620003956000396000f3fe6080604052600436106101755760003560e01c80636b351848116100cb578063a9059cbb1161007f578063dd62ed3e11610059578063dd62ed3e146103ec578063f48ab4e014610432578063f851a4401461043a57600080fd5b8063a9059cbb14610399578063b8e9744c146103b9578063be831a2e146103cc57600080fd5b80638d32caf4116100b05780638d32caf41461034457806395d89b4114610364578063a457c2d71461037957600080fd5b80636b351848146102ee57806370a082311461030e57600080fd5b8063313ce5671161012d57806340c10f191161010757806340c10f1914610298578063530208f2146102b85780635c975abb146102d857600080fd5b8063313ce5671461023657806337d2c2f414610258578063395093511461027857600080fd5b806318160ddd1161015e57806318160ddd146101d557806323b872dd146101f45780632692c59f1461021457600080fd5b806306fdde031461017a578063095ea7b3146101a5575b600080fd5b34801561018657600080fd5b5061018f610472565b60405161019c9190610f90565b60405180910390f35b3480156101b157600080fd5b506101c56101c0366004610fc2565b610504565b604051901515815260200161019c565b3480156101e157600080fd5b506002545b60405190815260200161019c565b34801561020057600080fd5b506101c561020f366004610fee565b61051c565b34801561022057600080fd5b5061023461022f36600461102f565b610540565b005b34801561024257600080fd5b5060095460405160ff909116815260200161019c565b34801561026457600080fd5b506102346102733660046110eb565b61055c565b34801561028457600080fd5b506101c5610293366004610fc2565b6105a5565b3480156102a457600080fd5b506102346102b3366004610fc2565b6105e4565b3480156102c457600080fd5b506102346102d3366004610fc2565b610609565b3480156102e457600080fd5b506101e660065481565b3480156102fa57600080fd5b50610234610309366004611169565b61065b565b34801561031a57600080fd5b506101e66103293660046111ae565b6001600160a01b031660009081526020819052604090205490565b34801561035057600080fd5b5061023461035f366004610fc2565b6106cb565b34801561037057600080fd5b5061018f610747565b34801561038557600080fd5b506101c5610394366004610fc2565b610756565b3480156103a557600080fd5b506101c56103b4366004610fc2565b610805565b61018f6103c73660046111cb565b610813565b3480156103d857600080fd5b506102346103e736600461121b565b61089f565b3480156103f857600080fd5b506101e661040736600461123d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6102346108ba565b34801561044657600080fd5b5060055461045a906001600160a01b031681565b6040516001600160a01b03909116815260200161019c565b60606007805461048190611276565b80601f01602080910402602001604051908101604052809291908181526020018280546104ad90611276565b80156104fa5780601f106104cf576101008083540402835291602001916104fa565b820191906000526020600020905b8154815290600101906020018083116104dd57829003601f168201915b5050505050905090565b6000336105128185856108d3565b5060019392505050565b60003361052a858285610a2b565b610535858585610abd565b506001949350505050565b6005546001600160a01b0316331461055757600080fd5b600655565b6005546001600160a01b0316331461057357600080fd5b600761057f84826112fe565b50600861058c83826112fe565b506009805460ff191660ff929092169190911790555050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061051290829086906105df9087906113d4565b6108d3565b6005546001600160a01b031633146105fb57600080fd5b6106058282610cd4565b5050565b6005546001600160a01b0316331461062057600080fd5b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610656573d6000803e3d6000fd5b505050565b610666335b82610db3565b604051819060009061067e90839086906020016113ec565b604051602081830303815290604052905060008451602161069f91906113d4565b9050602060008260208501600073e9217bc70b7ed1f598ddd3199e80b093fa71124f5af1505050505050565b6106d433610660565b604051600160f81b602082015260218101829052606083901b6bffffffffffffffffffffffff1981166041830152829160009060550160408051601f198184030181529190529050603560206000828285018273b0bd02f6a392af548bdf1cfaee5dfa0eefcc8eab5af150505050505050565b60606008805461048190611276565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156107f85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61053582868684036108d3565b600033610512818585610abd565b6005546060906001600160a01b0316331461082d57600080fd5b600080846001600160a01b031684604051610848919061141c565b600060405180830381855af49150503d8060008114610883576040519150601f19603f3d011682016040523d82523d6000602084013e610888565b606091505b50915091508161089757600080fd5b949350505050565b6005546001600160a01b031633146108b657600080fd5b9055565b6005546001600160a01b031633146108d157600080fd5b565b6001600160a01b03831661094e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016107ef565b6001600160a01b0382166109ca5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016107ef565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610ab75781811015610aaa5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016107ef565b610ab784848484036108d3565b50505050565b6001600160a01b038316610b395760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107ef565b6001600160a01b038216610bb55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016107ef565b6001600160a01b03831660009081526020819052604090205481811015610c445760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016107ef565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610c7b9084906113d4565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610cc791815260200190565b60405180910390a3610ab7565b6001600160a01b038216610d2a5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016107ef565b8060026000828254610d3c91906113d4565b90915550506001600160a01b03821660009081526020819052604081208054839290610d699084906113d4565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610e2f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016107ef565b6001600160a01b03821660009081526020819052604090205481811015610ebe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016107ef565b6001600160a01b0383166000908152602081905260408120838303905560028054849290610eed908490611438565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60005b83811015610f53578181015183820152602001610f3b565b83811115610ab75750506000910152565b60008151808452610f7c816020860160208601610f38565b601f01601f19169290920160200192915050565b602081526000610fa36020830184610f64565b9392505050565b6001600160a01b0381168114610fbf57600080fd5b50565b60008060408385031215610fd557600080fd5b8235610fe081610faa565b946020939093013593505050565b60008060006060848603121561100357600080fd5b833561100e81610faa565b9250602084013561101e81610faa565b929592945050506040919091013590565b60006020828403121561104157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261106f57600080fd5b813567ffffffffffffffff8082111561108a5761108a611048565b604051601f8301601f19908116603f011681019082821181831017156110b2576110b2611048565b816040528381528660208588010111156110cb57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561110057600080fd5b833567ffffffffffffffff8082111561111857600080fd5b6111248783880161105e565b9450602086013591508082111561113a57600080fd5b506111478682870161105e565b925050604084013560ff8116811461115e57600080fd5b809150509250925092565b6000806040838503121561117c57600080fd5b823567ffffffffffffffff81111561119357600080fd5b61119f8582860161105e565b95602094909401359450505050565b6000602082840312156111c057600080fd5b8135610fa381610faa565b600080604083850312156111de57600080fd5b82356111e981610faa565b9150602083013567ffffffffffffffff81111561120557600080fd5b6112118582860161105e565b9150509250929050565b6000806040838503121561122e57600080fd5b50508035926020909101359150565b6000806040838503121561125057600080fd5b823561125b81610faa565b9150602083013561126b81610faa565b809150509250929050565b600181811c9082168061128a57607f821691505b6020821081036112aa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561065657600081815260208120601f850160051c810160208610156112d75750805b601f850160051c820191505b818110156112f6578281556001016112e3565b505050505050565b815167ffffffffffffffff81111561131857611318611048565b61132c816113268454611276565b846112b0565b602080601f83116001811461136157600084156113495750858301515b600019600386901b1c1916600185901b1785556112f6565b600085815260208120601f198616915b8281101561139057888601518255948401946001909101908401611371565b50858210156113ae5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600082198211156113e7576113e76113be565b500190565b600160f81b81528260018201526000825161140e816021850160208701610f38565b919091016021019392505050565b6000825161142e818460208701610f38565b9190910192915050565b60008282101561144a5761144a6113be565b50039056fea2646970667358221220b231e3177ebd68f3996750307b59e00d2cf6edfa54922a143d1cd57e24842b5e64736f6c634300080f0033
Binary file added etc/eth-contracts/res/EvmErc20V2.bin
Binary file not shown.
Loading

0 comments on commit 11c8c29

Please sign in to comment.