From 3e42c1b3a074a6d7ad920c41b8efe72b34f3cf63 Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 21 Jul 2023 02:20:52 +0100 Subject: [PATCH 01/50] Implement silo to silo transfers --- silo-to-silo/.gitignore | 4 + silo-to-silo/.prettierrc.json | 14 + silo-to-silo/contracts/IEvmErc20.sol | 8 + silo-to-silo/contracts/SiloToSilo.sol | 182 ++ silo-to-silo/hardhat.config.js | 30 + silo-to-silo/package.json | 14 + silo-to-silo/yarn.lock | 2437 +++++++++++++++++++++++++ 7 files changed, 2689 insertions(+) create mode 100644 silo-to-silo/.gitignore create mode 100644 silo-to-silo/.prettierrc.json create mode 100644 silo-to-silo/contracts/IEvmErc20.sol create mode 100644 silo-to-silo/contracts/SiloToSilo.sol create mode 100644 silo-to-silo/hardhat.config.js create mode 100644 silo-to-silo/package.json create mode 100644 silo-to-silo/yarn.lock diff --git a/silo-to-silo/.gitignore b/silo-to-silo/.gitignore new file mode 100644 index 00000000..8ec84582 --- /dev/null +++ b/silo-to-silo/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +artifacts/ +cache/ +.env \ No newline at end of file diff --git a/silo-to-silo/.prettierrc.json b/silo-to-silo/.prettierrc.json new file mode 100644 index 00000000..6267dc1a --- /dev/null +++ b/silo-to-silo/.prettierrc.json @@ -0,0 +1,14 @@ +{ + "overrides": [ + { + "files": "*.sol", + "options": { + "printWidth": 120, + "tabWidth": 4, + "useTabs": false, + "singleQuote": false, + "bracketSpacing": false + } + } + ] + } \ No newline at end of file diff --git a/silo-to-silo/contracts/IEvmErc20.sol b/silo-to-silo/contracts/IEvmErc20.sol new file mode 100644 index 00000000..eee0d49e --- /dev/null +++ b/silo-to-silo/contracts/IEvmErc20.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.17; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +interface IEvmErc20 is IERC20 { + function withdrawToNear(bytes memory recipient, uint256 amount) external; +} diff --git a/silo-to-silo/contracts/SiloToSilo.sol b/silo-to-silo/contracts/SiloToSilo.sol new file mode 100644 index 00000000..aae1e2a5 --- /dev/null +++ b/silo-to-silo/contracts/SiloToSilo.sol @@ -0,0 +1,182 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.17; + +import {IERC20 as IERC20_NEAR} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {AuroraSdk, NEAR, PromiseCreateArgs, PromiseResultStatus, PromiseWithCallback} from "@auroraisnear/aurora-sdk/aurora-sdk/AuroraSdk.sol"; +import "@auroraisnear/aurora-sdk/aurora-sdk/Utils.sol"; +import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; +import "@openzeppelin/contracts/utils/Base64.sol"; +import "@openzeppelin/contracts/access/AccessControl.sol"; +import "./IEvmErc20.sol"; + +contract SiloToSilo is AccessControl { + using AuroraSdk for NEAR; + using AuroraSdk for PromiseCreateArgs; + using AuroraSdk for PromiseWithCallback; + + bytes32 public constant CALLBACK_ROLE = keccak256("CALLBACK_ROLE"); + + uint64 constant BASE_NEAR_GAS = 10_000_000_000_000; + uint64 constant WITHDRAW_NEAR_GAS = 50_000_000_000_000; + uint64 constant FT_TRANSFER_CALL_NEAR_GAS = 200_000_000_000_000; + + uint128 constant NEAR_STORAGE_DEPOSIT = 12_500_000_000_000_000_000_000; + + NEAR public near; + string siloAccountId; + + //[auroraErc20Token] => tokenAccountIdOnNear + mapping(IEvmErc20 => string) registeredTokens; + + //[auroraErc20Token][userAddressOnAurora] => userBalance + mapping(IEvmErc20 => mapping(address => uint128)) balance; + + event TokenRegistered(IEvmErc20 token, string nearAccountId); + + constructor(address wnearAddress, string memory _siloAccountId) { + near = AuroraSdk.initNear(IERC20_NEAR(wnearAddress)); + siloAccountId = _siloAccountId; + + _grantRole(CALLBACK_ROLE, AuroraSdk.nearRepresentitiveImplicitAddress(address(this))); + _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + } + + // TODO: make it trustless + function registerToken(IEvmErc20 token, string memory nearTokenAccountId) public onlyRole(DEFAULT_ADMIN_ROLE) { + near.wNEAR.transferFrom(msg.sender, address(this), uint256(NEAR_STORAGE_DEPOSIT)); + bytes memory args = bytes( + string.concat('{"account_id": "', getNearAccountId(), '", "registration_only": true }') + ); + + PromiseCreateArgs memory callStorageDeposit = near.call( + nearTokenAccountId, + "storage_deposit", + args, + NEAR_STORAGE_DEPOSIT, + BASE_NEAR_GAS + ); + callStorageDeposit.transact(); + + registeredTokens[token] = nearTokenAccountId; + emit TokenRegistered(token, nearTokenAccountId); + } + + function ftTransferCallToNear( + IEvmErc20 token, + uint128 amount, + string calldata receiverId, + string calldata message + ) external { + string storage tokenAccountId = registeredTokens[token]; + require(address(token) != address(0), "The token is not registered!"); + + token.transferFrom(msg.sender, address(this), amount); + // WARNING: The `withdrawToNear` method works asynchronously. + // As a result, there is no guarantee that this method will be completed before `initTransfer`. + // In case of such an error, the user will be able to call `withdraw` method and get his/her tokens back. + // We expect such an error not to happen as long as transactions were executed in one shard. + token.withdrawToNear(bytes(getNearAccountId()), amount); + + bytes memory args = bytes( + string.concat( + '{"receiver_id": "', + receiverId, + '", "amount": "', + Strings.toString(amount), + '", "msg": "', + message, + '"}' + ) + ); + + PromiseCreateArgs memory callFtTransfer = near.call( + tokenAccountId, + "ft_transfer_call", + args, + 1, + FT_TRANSFER_CALL_NEAR_GAS + ); + bytes memory callbackArg = abi.encodeWithSelector(this.ftTransferCallCallback.selector, msg.sender, amount); + PromiseCreateArgs memory callback = near.auroraCall(address(this), callbackArg, 0, BASE_NEAR_GAS); + + callFtTransfer.then(callback).transact(); + } + + function ftTransferCallCallback(address sender, IEvmErc20 token, uint128 amount) public onlyRole(CALLBACK_ROLE) { + uint128 transferredAmount = 0; + + if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { + transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); + } + + balance[token][sender] += (amount - transferredAmount); + } + + function withdraw(IEvmErc20 token) public { + string storage tokenAccountId = registeredTokens[token]; + uint128 senderBalance = balance[token][msg.sender]; + + require(senderBalance > 0, "The signer token balance = 0"); + + near.wNEAR.transferFrom(msg.sender, address(this), uint256(1)); + bytes memory args = bytes( + string.concat( + '{"receiver_id":', + siloAccountId, + '"amount": "', + Strings.toString(senderBalance), + '", "msg": "', + _addressToString(msg.sender), + '"}' + ) + ); + PromiseCreateArgs memory callWithdraw = near.call( + tokenAccountId, + "ft_transfer_call", + args, + 1, + WITHDRAW_NEAR_GAS + ); + bytes memory callbackArg = abi.encodeWithSelector(this.withdrawCallback.selector, msg.sender, token); + PromiseCreateArgs memory callback = near.auroraCall(address(this), callbackArg, 0, BASE_NEAR_GAS); + + callWithdraw.then(callback).transact(); + } + + function withdrawCallback(address sender, IEvmErc20 token) public onlyRole(CALLBACK_ROLE) { + require( + AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, + "ERROR: The `Withdraw` XCC is fail" + ); + + uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); + + if (transferredAmount > 0) { + balance[token][sender] -= transferredAmount; + } + } + + function getNearAccountId() public view returns (string memory) { + return string.concat(_addressToString(address(this)), ".", siloAccountId); + } + + function getTokenAccountId(IEvmErc20 token) public view returns (string memory) { + return registeredTokens[token]; + } + + function getUserBalance(IEvmErc20 token, address userAddress) public view returns (uint128) { + return balance[token][userAddress]; + } + + function _addressToString(address auroraAddress) private pure returns (string memory) { + return Utils.bytesToHex(abi.encodePacked(auroraAddress)); + } + + function _stringToUint(bytes memory b) private pure returns (uint128) { + uint128 result = 0; + for (uint256 i = 0; i < b.length; i++) { + result = result * 10 + (uint128(uint8(b[i])) - 48); + } + return result; + } +} diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js new file mode 100644 index 00000000..1ffd0a5d --- /dev/null +++ b/silo-to-silo/hardhat.config.js @@ -0,0 +1,30 @@ +require('dotenv').config(); + +const AURORA_PRIVATE_KEY = process.env.AURORA_PRIVATE_KEY; + +module.exports = { + solidity: { + version: "0.8.17", + settings: { + optimizer: { + enabled: true, + runs: 200 + } + } + }, + networks: { + testnet_aurora: { + url: 'https://testnet.aurora.dev', + accounts: [`0x${AURORA_PRIVATE_KEY}`], + chainId: 1313161555 + }, + develop_aurora: { + url: 'https://develop.rpc.testnet.aurora.dev:8545', + accounts: [`0x${AURORA_PRIVATE_KEY}`] + }, + }, + mocha: { + timeout: 100000000 + } +}; + diff --git a/silo-to-silo/package.json b/silo-to-silo/package.json new file mode 100644 index 00000000..7fd5c05e --- /dev/null +++ b/silo-to-silo/package.json @@ -0,0 +1,14 @@ +{ + "name": "hardhat-project", + "license": "MIT", + "devDependencies": { + "hardhat": "^2.17", + "prettier": "^3", + "prettier-plugin-solidity": "^1.1.3" + }, + "dependencies": { + "@auroraisnear/aurora-sdk": "^0.0.1", + "@openzeppelin/contracts": "^4.8.1", + "dotenv": "^16" + } +} \ No newline at end of file diff --git a/silo-to-silo/yarn.lock b/silo-to-silo/yarn.lock new file mode 100644 index 00000000..9c94ca0a --- /dev/null +++ b/silo-to-silo/yarn.lock @@ -0,0 +1,2437 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@auroraisnear/aurora-sdk@^0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@auroraisnear/aurora-sdk/-/aurora-sdk-0.0.1.tgz#5f95deaa11b6d9c921380b1981902aa421ed0cdc" + integrity sha512-lfRh80keYyeBg8Zq9nAzhAJ+CD9p35qvlfT5ERAXkm9ZITlGceJh6L90H/W73ubnI4n3MqHlxvrsEzZlGPACIA== + dependencies: + "@openzeppelin/contracts" "^4.8.2" + +"@chainsafe/as-sha256@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" + integrity sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg== + +"@chainsafe/persistent-merkle-tree@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz#4c9ee80cc57cd3be7208d98c40014ad38f36f7ff" + integrity sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/persistent-merkle-tree@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz#2b4a62c9489a5739dedd197250d8d2f5427e9f63" + integrity sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/ssz@^0.10.0": + version "0.10.2" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.10.2.tgz#c782929e1bb25fec66ba72e75934b31fd087579e" + integrity sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.5.0" + +"@chainsafe/ssz@^0.9.2": + version "0.9.4" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.9.4.tgz#696a8db46d6975b600f8309ad3a12f7c0e310497" + integrity sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.4.2" + case "^1.6.3" + +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" + integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/contracts@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" + integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" + integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" + integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" + integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.1", "@ethersproject/providers@^5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" + integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" + integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" + integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/units@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" + integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/wallet@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" + integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/json-wallets" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" + integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@metamask/eth-sig-util@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" + integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + +"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + +"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + +"@nomicfoundation/ethereumjs-block@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz#6f89664f55febbd723195b6d0974773d29ee133d" + integrity sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + ethereum-cryptography "0.1.3" + ethers "^5.7.1" + +"@nomicfoundation/ethereumjs-blockchain@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz#80e0bd3535bfeb9baa29836b6f25123dab06a726" + integrity sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-ethash" "3.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + abstract-level "^1.0.3" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + level "^8.0.0" + lru-cache "^5.1.1" + memory-level "^1.0.0" + +"@nomicfoundation/ethereumjs-common@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz#4702d82df35b07b5407583b54a45bf728e46a2f0" + integrity sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g== + dependencies: + "@nomicfoundation/ethereumjs-util" "9.0.1" + crc-32 "^1.2.0" + +"@nomicfoundation/ethereumjs-ethash@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz#65ca494d53e71e8415c9a49ef48bc921c538fc41" + integrity sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + abstract-level "^1.0.3" + bigint-crypto-utils "^3.0.23" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-evm@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz#f35681e203363f69ce2b3d3bf9f44d4e883ca1f1" + integrity sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ== + dependencies: + "@ethersproject/providers" "^5.7.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + mcl-wasm "^0.7.1" + rustbn.js "~0.2.0" + +"@nomicfoundation/ethereumjs-rlp@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz#0b30c1cf77d125d390408e391c4bb5291ef43c28" + integrity sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ== + +"@nomicfoundation/ethereumjs-statemanager@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz#8824a97938db4471911e2d2f140f79195def5935" + integrity sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + ethers "^5.7.1" + js-sdsl "^4.1.4" + +"@nomicfoundation/ethereumjs-trie@6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz#662c55f6b50659fd4b22ea9f806a7401cafb7717" + integrity sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + "@types/readable-stream" "^2.3.13" + ethereum-cryptography "0.1.3" + readable-stream "^3.6.0" + +"@nomicfoundation/ethereumjs-tx@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz#7629dc2036b4a33c34e9f0a592b43227ef4f0c7d" + integrity sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w== + dependencies: + "@chainsafe/ssz" "^0.9.2" + "@ethersproject/providers" "^5.7.2" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz#530cda8bae33f8b5020a8f199ed1d0a2ce48ec89" + integrity sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA== + dependencies: + "@chainsafe/ssz" "^0.10.0" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-vm@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz#7d035e0993bcad10716c8b36e61dfb87fa3ca05f" + integrity sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-blockchain" "7.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-evm" "2.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-statemanager" "2.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + mcl-wasm "^0.7.1" + rustbn.js "~0.2.0" + +"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" + integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== + +"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" + integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== + +"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" + integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== + +"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" + integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== + +"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" + integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== + +"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" + integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== + +"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" + integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== + +"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" + integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== + +"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" + integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== + +"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" + integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== + +"@nomicfoundation/solidity-analyzer@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" + integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== + optionalDependencies: + "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" + "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" + +"@openzeppelin/contracts@^4.8.1", "@openzeppelin/contracts@^4.8.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1" + integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg== + +"@scure/base@~1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" + integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== + +"@scure/bip32@1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== + dependencies: + "@noble/hashes" "~1.2.0" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== + dependencies: + "@noble/hashes" "~1.2.0" + "@scure/base" "~1.1.0" + +"@sentry/core@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/hub@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + dependencies: + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/minimal@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" + integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== + dependencies: + "@sentry/core" "5.30.0" + "@sentry/hub" "5.30.0" + "@sentry/tracing" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/types@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + +"@sentry/utils@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + dependencies: + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@solidity-parser/parser@^0.16.0": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.16.1.tgz#f7c8a686974e1536da0105466c4db6727311253c" + integrity sha512-PdhRFNhbTtu3x8Axm0uYpqOy/lODYQK+MlYSgqIsq2L8SFYEHJPHNUiOTAJbDGzNjjr1/n9AcIayxafR/fWmYw== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@types/bn.js@^4.11.3": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/bn.js@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + +"@types/lru-cache@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" + integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== + +"@types/node@*": + version "20.4.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" + integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== + +"@types/pbkdf2@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== + dependencies: + "@types/node" "*" + +"@types/readable-stream@^2.3.13": + version "2.3.15" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" + integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== + dependencies: + "@types/node" "*" + safe-buffer "~5.1.1" + +"@types/secp256k1@^4.0.1": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + dependencies: + "@types/node" "*" + +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + +abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" + integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== + dependencies: + buffer "^6.0.3" + catering "^2.1.0" + is-buffer "^2.0.5" + level-supports "^4.0.0" + level-transcoder "^1.0.1" + module-error "^1.0.1" + queue-microtask "^1.2.3" + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-colors@^4.1.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +antlr4ts@^0.5.0-alpha.4: + version "0.5.0-alpha.4" + resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" + integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +bigint-crypto-utils@^3.0.23: + version "3.3.0" + resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz#72ad00ae91062cf07f2b1def9594006c279c1d77" + integrity sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +browser-level@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browser-level/-/browser-level-1.0.1.tgz#36e8c3183d0fe1c405239792faaab5f315871011" + integrity sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.1" + module-error "^1.0.2" + run-parallel-limit "^1.1.0" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +busboy@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +camelcase@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +case@^1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" + integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== + +catering@^2.1.0, catering@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" + integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@3.5.3, chokidar@^3.4.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +classic-level@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.3.0.tgz#5e36680e01dc6b271775c093f2150844c5edd5c8" + integrity sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.0" + module-error "^1.0.1" + napi-macros "^2.2.2" + node-gyp-build "^4.3.0" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== + +commander@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +cookie@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + +crc-32@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" + integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.3: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +dotenv@^16: + version "16.3.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" + integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== + +elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +enquirer@^2.3.0: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-cryptography@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== + dependencies: + "@noble/hashes" "1.2.0" + "@noble/secp256k1" "1.7.1" + "@scure/bip32" "1.1.5" + "@scure/bip39" "1.1.1" + +ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethers@^5.7.1: + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.0" + +ethjs-util@0.1.6, ethjs-util@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + +evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== + dependencies: + locate-path "^2.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +follow-redirects@^1.12.1: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +hardhat@^2.17: + version "2.17.0" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.0.tgz#574478790fa4f4a45c5ccf162e82e54f36671749" + integrity sha512-CaEGa13tkJNe2/rdaBiive4pmdNShwxvdWVhr1zfb6aVpRhQt9VNO0l/UIBt/zzajz38ZFjvhfM2bj8LDXo9gw== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-blockchain" "7.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-evm" "2.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-statemanager" "2.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + "@nomicfoundation/ethereumjs-vm" "7.0.1" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + abort-controller "^3.0.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +immutable@^4.0.0-rc.12: + version "4.3.1" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.1.tgz#17988b356097ab0719e2f741d56f3ec6c317f9dc" + integrity sha512-lj9cnmB/kVS0QHsJnYKD1uo3o39nrbKxszjnqS9Fr6NB7bZzW45U6WSGBPKXDL/CvDKqDNPA4r3DoDQ8GTxo2A== + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== + dependencies: + fp-ts "^1.0.0" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-buffer@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +js-sdsl@^4.1.4: + version "4.4.1" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.1.tgz#9e3c7b566d8d9a7e1fe8fc26d00b5ab0f8918ab3" + integrity sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA== + +js-sha3@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +keccak@^3.0.0, keccak@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" + integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== + optionalDependencies: + graceful-fs "^4.1.9" + +level-supports@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" + integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== + +level-transcoder@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" + integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== + dependencies: + buffer "^6.0.3" + module-error "^1.0.1" + +level@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/level/-/level-8.0.0.tgz#41b4c515dabe28212a3e881b61c161ffead14394" + integrity sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ== + dependencies: + browser-level "^1.0.1" + classic-level "^1.2.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.11: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== + +mcl-wasm@^0.7.1: + version "0.7.9" + resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" + integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +memory-level@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" + integrity sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og== + dependencies: + abstract-level "^1.0.0" + functional-red-black-tree "^1.0.1" + module-error "^1.0.1" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +mnemonist@^0.38.0: + version "0.38.5" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" + integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== + dependencies: + obliterator "^2.0.0" + +mocha@^10.0.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" + integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== + dependencies: + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +module-error@^1.0.1, module-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" + integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== + +napi-macros@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.2.2.tgz#817fef20c3e0e40a963fbf7b37d1600bd0201044" + integrity sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g== + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" + integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +obliterator@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== + dependencies: + p-limit "^1.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +pbkdf2@^3.0.17: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +prettier-plugin-solidity@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.3.tgz#9a35124f578404caf617634a8cab80862d726cba" + integrity sha512-fQ9yucPi2sBbA2U2Xjh6m4isUTJ7S7QLc/XDDsktqqxYfTwdYKJ0EnnywXHwCGAaYbQNK+HIYPL1OemxuMsgeg== + dependencies: + "@solidity-parser/parser" "^0.16.0" + semver "^7.3.8" + solidity-comments-extractor "^0.0.7" + +prettier@^3: + version "3.0.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" + integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== + +queue-microtask@^1.2.2, queue-microtask@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +raw-body@^2.4.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-from-string@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +rimraf@^2.2.8: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.2.3: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + +run-parallel-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba" + integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw== + dependencies: + queue-microtask "^1.2.2" + +rustbn.js@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" + integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scrypt-js@3.0.1, scrypt-js@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +semver@^5.5.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@^6.3.0: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.3.8: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +solc@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + follow-redirects "^1.12.1" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solidity-comments-extractor@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" + integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== + +source-map-support@^0.5.13: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +tmp@0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== + +tweetnacl-util@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== + +tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + +undici@^5.14.0: + version "5.22.1" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b" + integrity sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw== + dependencies: + busboy "^1.6.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +unpipe@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@7.4.6: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + +ws@^7.4.6: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 14899330a818aa59102cb827699b39199487080b Mon Sep 17 00:00:00 2001 From: karim-en Date: Tue, 8 Aug 2023 15:35:02 +0100 Subject: [PATCH 02/50] Silo2Silo: Pass deposit amount on register token --- silo-to-silo/contracts/SiloToSilo.sol | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/silo-to-silo/contracts/SiloToSilo.sol b/silo-to-silo/contracts/SiloToSilo.sol index aae1e2a5..98a14fb1 100644 --- a/silo-to-silo/contracts/SiloToSilo.sol +++ b/silo-to-silo/contracts/SiloToSilo.sol @@ -20,8 +20,6 @@ contract SiloToSilo is AccessControl { uint64 constant WITHDRAW_NEAR_GAS = 50_000_000_000_000; uint64 constant FT_TRANSFER_CALL_NEAR_GAS = 200_000_000_000_000; - uint128 constant NEAR_STORAGE_DEPOSIT = 12_500_000_000_000_000_000_000; - NEAR public near; string siloAccountId; @@ -42,8 +40,12 @@ contract SiloToSilo is AccessControl { } // TODO: make it trustless - function registerToken(IEvmErc20 token, string memory nearTokenAccountId) public onlyRole(DEFAULT_ADMIN_ROLE) { - near.wNEAR.transferFrom(msg.sender, address(this), uint256(NEAR_STORAGE_DEPOSIT)); + function registerToken( + IEvmErc20 token, + string memory nearTokenAccountId, + uint128 storageDepositAmount + ) public onlyRole(DEFAULT_ADMIN_ROLE) { + near.wNEAR.transferFrom(msg.sender, address(this), uint256(storageDepositAmount)); bytes memory args = bytes( string.concat('{"account_id": "', getNearAccountId(), '", "registration_only": true }') ); @@ -52,7 +54,7 @@ contract SiloToSilo is AccessControl { nearTokenAccountId, "storage_deposit", args, - NEAR_STORAGE_DEPOSIT, + storageDepositAmount, BASE_NEAR_GAS ); callStorageDeposit.transact(); @@ -112,7 +114,7 @@ contract SiloToSilo is AccessControl { balance[token][sender] += (amount - transferredAmount); } - function withdraw(IEvmErc20 token) public { + function withdraw(IEvmErc20 token) external { string storage tokenAccountId = registeredTokens[token]; uint128 senderBalance = balance[token][msg.sender]; From be4dea6439b53c93ab4611066208c2b4d8ef364c Mon Sep 17 00:00:00 2001 From: Olga Kunyavskaya Date: Thu, 10 Aug 2023 18:08:33 +0300 Subject: [PATCH 03/50] Silo to silo tests (#226) * integration test fro silo to silo * add aurora-sdk-integartion-test * split functions * add module * change balance * remove debug println * fmt * silo to engine transfer * withdraw test * fix withdraw * refactoring * check access controll * check if token is register * test error on withdraw from near * fix dependency * fix String to Uint * CI: add `silo-to-silo` tests * Silo2Silo: fix tests * CI; replace `true` with `recursive` * Update `.gitignore` * CI: try to fix path issue * CI: check submodule dir is exist * CI: install Foundry * Add yarn the command `test-token-silo-to-silo` * CI: call `prepare` * CI: add toolchain to `mock_token` * CI: add `actions-rs` * Ci: run `silo-to-silo` tests on ubuntu * CI: disable building from test * CI: add `add wasm32-unknown-unknown` command * CI: move down ` add wasm32-unknown-unknown` * CI: re-enable tests * CI: run tests in parallel * Apply `cargo fmt` * CI: use `self-hosted` * Ignore test `error_on_withdraw_to_near` --------- Co-authored-by: karim-en --- .github/workflows/tests.yml | 14 + .gitmodules | 3 + Makefile | 9 + silo-to-silo/.gitignore | 3 +- silo-to-silo/contracts/foundry.toml | 8 + .../contracts/{ => src}/IEvmErc20.sol | 0 .../contracts/{ => src}/SiloToSilo.sol | 41 +- silo-to-silo/integration-tests/Cargo.lock | 3907 +++++++++++++++++ silo-to-silo/integration-tests/Cargo.toml | 9 + .../integration-tests/aurora-contracts-sdk | 1 + .../integration-tests/mock_token/Cargo.lock | 1548 +++++++ .../integration-tests/mock_token/Cargo.toml | 13 + .../mock_token/rust-toolchain | 3 + .../integration-tests/mock_token/src/lib.rs | 281 ++ silo-to-silo/integration-tests/rust-toolchain | 3 + silo-to-silo/integration-tests/src/lib.rs | 885 ++++ 16 files changed, 6708 insertions(+), 20 deletions(-) create mode 100644 .gitmodules create mode 100644 silo-to-silo/contracts/foundry.toml rename silo-to-silo/contracts/{ => src}/IEvmErc20.sol (100%) rename silo-to-silo/contracts/{ => src}/SiloToSilo.sol (87%) create mode 100644 silo-to-silo/integration-tests/Cargo.lock create mode 100644 silo-to-silo/integration-tests/Cargo.toml create mode 160000 silo-to-silo/integration-tests/aurora-contracts-sdk create mode 100644 silo-to-silo/integration-tests/mock_token/Cargo.lock create mode 100644 silo-to-silo/integration-tests/mock_token/Cargo.toml create mode 100644 silo-to-silo/integration-tests/mock_token/rust-toolchain create mode 100644 silo-to-silo/integration-tests/mock_token/src/lib.rs create mode 100644 silo-to-silo/integration-tests/rust-toolchain create mode 100644 silo-to-silo/integration-tests/src/lib.rs diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4592a55c..e262cc5c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -88,3 +88,17 @@ jobs: - name: Test run: | make test-token-locker + + test-silo-to-silo: + runs-on: self-hosted + name: Test silo-to-silo + steps: + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + - name: Clone the repository + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Test + run: | + make test-token-silo-to-silo diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..f9e35146 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "silo-to-silo/integration-tests/aurora-contracts-sdk"] + path = silo-to-silo/integration-tests/aurora-contracts-sdk + url = https://github.com/aurora-is-near/aurora-contracts-sdk.git diff --git a/Makefile b/Makefile index da765f71..663f0eee 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,15 @@ test-token-locker: cd token-locker && \ cargo test --all +test-token-silo-to-silo: + cd silo-to-silo && \ + yarn && \ + cd integration-tests && \ + rustup target add wasm32-unknown-unknown && \ + export RUSTFLAGS='-C link-arg=-s' && \ + $(CARGO) build --target wasm32-unknown-unknown --release --manifest-path mock_token/Cargo.toml && \ + cargo test --all --jobs 4 -- --test-threads 4 + # <-- # For testing purposes only (can be removed at any moment) no_icon: res/bridge_token_no_icon.wasm res/bridge_token_factory_no_icon.wasm diff --git a/silo-to-silo/.gitignore b/silo-to-silo/.gitignore index 8ec84582..745d8b50 100644 --- a/silo-to-silo/.gitignore +++ b/silo-to-silo/.gitignore @@ -1,4 +1,5 @@ node_modules/ artifacts/ cache/ -.env \ No newline at end of file +.env +contracts/out/* \ No newline at end of file diff --git a/silo-to-silo/contracts/foundry.toml b/silo-to-silo/contracts/foundry.toml new file mode 100644 index 00000000..ae0e840f --- /dev/null +++ b/silo-to-silo/contracts/foundry.toml @@ -0,0 +1,8 @@ +[profile.default] +src = 'src' +out = 'out' +libs = ['lib', '../node_modules', '../integration-tests/aurora-contracts-sdk/aurora-solidity-sdk/lib'] +allow_paths = ['../node_modules', '../integration-tests/aurora-contracts-sdk/aurora-solidity-sdk/'] +solc = "0.8.17" + +# See more config options https://github.com/foundry-rs/foundry/tree/master/config diff --git a/silo-to-silo/contracts/IEvmErc20.sol b/silo-to-silo/contracts/src/IEvmErc20.sol similarity index 100% rename from silo-to-silo/contracts/IEvmErc20.sol rename to silo-to-silo/contracts/src/IEvmErc20.sol diff --git a/silo-to-silo/contracts/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol similarity index 87% rename from silo-to-silo/contracts/SiloToSilo.sol rename to silo-to-silo/contracts/src/SiloToSilo.sol index 98a14fb1..a2dc3940 100644 --- a/silo-to-silo/contracts/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -18,7 +18,7 @@ contract SiloToSilo is AccessControl { uint64 constant BASE_NEAR_GAS = 10_000_000_000_000; uint64 constant WITHDRAW_NEAR_GAS = 50_000_000_000_000; - uint64 constant FT_TRANSFER_CALL_NEAR_GAS = 200_000_000_000_000; + uint64 constant FT_TRANSFER_CALL_NEAR_GAS = 150_000_000_000_000; NEAR public near; string siloAccountId; @@ -27,7 +27,7 @@ contract SiloToSilo is AccessControl { mapping(IEvmErc20 => string) registeredTokens; //[auroraErc20Token][userAddressOnAurora] => userBalance - mapping(IEvmErc20 => mapping(address => uint128)) balance; + mapping(IEvmErc20 => mapping(address => uint256)) balance; event TokenRegistered(IEvmErc20 token, string nearAccountId); @@ -65,12 +65,12 @@ contract SiloToSilo is AccessControl { function ftTransferCallToNear( IEvmErc20 token, - uint128 amount, + uint256 amount, string calldata receiverId, string calldata message ) external { string storage tokenAccountId = registeredTokens[token]; - require(address(token) != address(0), "The token is not registered!"); + require(bytes(tokenAccountId).length > 0, "The token is not registered!"); token.transferFrom(msg.sender, address(this), amount); // WARNING: The `withdrawToNear` method works asynchronously. @@ -98,14 +98,15 @@ contract SiloToSilo is AccessControl { 1, FT_TRANSFER_CALL_NEAR_GAS ); - bytes memory callbackArg = abi.encodeWithSelector(this.ftTransferCallCallback.selector, msg.sender, amount); + + bytes memory callbackArg = abi.encodeWithSelector(this.ftTransferCallCallback.selector, msg.sender, token, amount); PromiseCreateArgs memory callback = near.auroraCall(address(this), callbackArg, 0, BASE_NEAR_GAS); callFtTransfer.then(callback).transact(); } - function ftTransferCallCallback(address sender, IEvmErc20 token, uint128 amount) public onlyRole(CALLBACK_ROLE) { - uint128 transferredAmount = 0; + function ftTransferCallCallback(address sender, IEvmErc20 token, uint256 amount) public onlyRole(CALLBACK_ROLE) { + uint256 transferredAmount = 0; if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); @@ -116,16 +117,16 @@ contract SiloToSilo is AccessControl { function withdraw(IEvmErc20 token) external { string storage tokenAccountId = registeredTokens[token]; - uint128 senderBalance = balance[token][msg.sender]; + uint256 senderBalance = balance[token][msg.sender]; require(senderBalance > 0, "The signer token balance = 0"); near.wNEAR.transferFrom(msg.sender, address(this), uint256(1)); bytes memory args = bytes( string.concat( - '{"receiver_id":', + '{"receiver_id": "', siloAccountId, - '"amount": "', + '", "amount": "', Strings.toString(senderBalance), '", "msg": "', _addressToString(msg.sender), @@ -151,11 +152,8 @@ contract SiloToSilo is AccessControl { "ERROR: The `Withdraw` XCC is fail" ); - uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); - - if (transferredAmount > 0) { - balance[token][sender] -= transferredAmount; - } + uint256 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); + balance[token][sender] -= transferredAmount; } function getNearAccountId() public view returns (string memory) { @@ -166,7 +164,7 @@ contract SiloToSilo is AccessControl { return registeredTokens[token]; } - function getUserBalance(IEvmErc20 token, address userAddress) public view returns (uint128) { + function getUserBalance(IEvmErc20 token, address userAddress) public view returns (uint256) { return balance[token][userAddress]; } @@ -174,11 +172,16 @@ contract SiloToSilo is AccessControl { return Utils.bytesToHex(abi.encodePacked(auroraAddress)); } - function _stringToUint(bytes memory b) private pure returns (uint128) { - uint128 result = 0; + function _stringToUint(bytes memory b) private pure returns (uint256) { + uint256 result = 0; + for (uint256 i = 0; i < b.length; i++) { - result = result * 10 + (uint128(uint8(b[i])) - 48); + uint256 v = uint256(uint8(b[i])); + if (v >= 48 && v <= 57) { + result = result * 10 + (v - 48); + } } + return result; } } diff --git a/silo-to-silo/integration-tests/Cargo.lock b/silo-to-silo/integration-tests/Cargo.lock new file mode 100644 index 00000000..3c3f7a54 --- /dev/null +++ b/silo-to-silo/integration-tests/Cargo.lock @@ -0,0 +1,3907 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix 0.37.23", + "slab", + "socket2", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-process" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +dependencies = [ + "async-io", + "async-lock", + "autocfg", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "rustix 0.37.23", + "signal-hook", + "windows-sys", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "async-trait" +version = "0.1.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + +[[package]] +name = "aurora-engine" +version = "2.9.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=cd4e046699a72cab0adf02bb5d7c47783732cf1b#cd4e046699a72cab0adf02bb5d7c47783732cf1b" +dependencies = [ + "aurora-engine-precompiles", + "aurora-engine-sdk", + "aurora-engine-transactions", + "aurora-engine-types", + "bitflags 1.3.2", + "byte-slice-cast", + "ethabi", + "evm", + "hex 0.4.3", + "rlp", + "serde", + "serde_json", + "wee_alloc", +] + +[[package]] +name = "aurora-engine-modexp" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=cd4e046699a72cab0adf02bb5d7c47783732cf1b#cd4e046699a72cab0adf02bb5d7c47783732cf1b" +dependencies = [ + "hex 0.4.3", + "num", +] + +[[package]] +name = "aurora-engine-precompiles" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=cd4e046699a72cab0adf02bb5d7c47783732cf1b#cd4e046699a72cab0adf02bb5d7c47783732cf1b" +dependencies = [ + "aurora-engine-modexp", + "aurora-engine-sdk", + "aurora-engine-types", + "ethabi", + "evm", + "hex 0.4.3", + "libsecp256k1", + "num", + "ripemd", + "sha2 0.10.7", + "sha3", + "zeropool-bn", +] + +[[package]] +name = "aurora-engine-sdk" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=cd4e046699a72cab0adf02bb5d7c47783732cf1b#cd4e046699a72cab0adf02bb5d7c47783732cf1b" +dependencies = [ + "aurora-engine-types", + "base64 0.21.2", + "sha2 0.10.7", + "sha3", +] + +[[package]] +name = "aurora-engine-transactions" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=cd4e046699a72cab0adf02bb5d7c47783732cf1b#cd4e046699a72cab0adf02bb5d7c47783732cf1b" +dependencies = [ + "aurora-engine-precompiles", + "aurora-engine-sdk", + "aurora-engine-types", + "evm", + "rlp", +] + +[[package]] +name = "aurora-engine-types" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=cd4e046699a72cab0adf02bb5d7c47783732cf1b#cd4e046699a72cab0adf02bb5d7c47783732cf1b" +dependencies = [ + "borsh 0.10.3", + "borsh 0.9.3", + "hex 0.4.3", + "primitive-types 0.12.1", + "serde", + "serde_json", +] + +[[package]] +name = "aurora-sdk-integration-tests" +version = "0.1.0" +source = "git+https://github.com/aurora-is-near/aurora-contracts-sdk.git?branch=silo#21d3d310fdfc185d2867b782f45682bf051f2d36" +dependencies = [ + "anyhow", + "aurora-engine", + "aurora-engine-precompiles", + "aurora-engine-sdk", + "aurora-engine-transactions", + "aurora-engine-types", + "base64 0.21.2", + "ethabi", + "hex 0.4.3", + "near-sdk", + "serde", + "serde_json", + "tokio", + "toml", + "workspaces", +] + +[[package]] +name = "auto_impl" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "binary-install" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5bc5f8c50dd6a80d0b303ddab79f42ddcb52fd43d68107ecf622c551fd4cd4" +dependencies = [ + "curl", + "dirs 1.0.5", + "failure", + "flate2", + "hex 0.3.2", + "is_executable", + "siphasher", + "tar", + "zip", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty 1.1.0", + "radium 0.6.2", + "tap", + "wyz 0.2.0", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty 2.0.0", + "radium 0.7.0", + "tap", + "wyz 0.5.1", +] + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "blake2b_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand 1.9.0", + "futures-lite", + "log", +] + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive 0.10.3", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bytesize" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" +dependencies = [ + "cipher", + "ppv-lite86", +] + +[[package]] +name = "cc" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curl" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.65+curl-8.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "961ba061c9ef2fe34bbd12b807152d96f0badd2bebe7b90ce6c8c8b7572a0986" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" +dependencies = [ + "libc", + "redox_users 0.3.5", + "winapi", +] + +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users 0.4.3", + "winapi", +] + +[[package]] +name = "dyn-clone" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" + +[[package]] +name = "easy-ext" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "ethabi" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +dependencies = [ + "ethereum-types", + "hex 0.4.3", + "once_cell", + "regex", + "serde", + "serde_json", + "sha3", + "thiserror", + "uint", +] + +[[package]] +name = "ethbloom" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +dependencies = [ + "crunchy", + "fixed-hash 0.8.0", + "impl-codec 0.6.0", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db", + "hash256-std-hasher", + "parity-scale-codec 3.6.4", + "rlp", + "scale-info", + "serde", + "sha3", + "triehash", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash 0.8.0", + "impl-codec 0.6.0", + "impl-rlp", + "impl-serde", + "primitive-types 0.12.1", + "scale-info", + "uint", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "evm" +version = "0.37.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.4-aurora#a7a0fb429d5fd479aecaa51687cad1f818772051" +dependencies = [ + "auto_impl", + "environmental", + "ethereum", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "parity-scale-codec 3.6.4", + "primitive-types 0.12.1", + "rlp", + "scale-info", + "serde", + "sha3", +] + +[[package]] +name = "evm-core" +version = "0.37.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.4-aurora#a7a0fb429d5fd479aecaa51687cad1f818772051" +dependencies = [ + "parity-scale-codec 3.6.4", + "primitive-types 0.12.1", + "scale-info", + "serde", +] + +[[package]] +name = "evm-gasometer" +version = "0.37.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.4-aurora#a7a0fb429d5fd479aecaa51687cad1f818772051" +dependencies = [ + "environmental", + "evm-core", + "evm-runtime", + "primitive-types 0.12.1", +] + +[[package]] +name = "evm-runtime" +version = "0.37.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.37.4-aurora#a7a0fb429d5fd479aecaa51687cad1f818772051" +dependencies = [ + "auto_impl", + "environmental", + "evm-core", + "primitive-types 0.12.1", + "sha3", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.3.5", + "windows-sys", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "flate2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac", +] + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +dependencies = [ + "parity-scale-codec 2.3.1", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec 3.6.4", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is_executable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d553b8abc8187beb7d663e34c065ac4570b273bc9511a50e940e99409c577" +dependencies = [ + "winapi", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libz-sys" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "near-abi" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "885db39b08518fa700b73fa2214e8adbbfba316ba82dd510f50519173eadaf73" +dependencies = [ + "borsh 0.9.3", + "schemars", + "semver", + "serde", +] + +[[package]] +name = "near-account-id" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d258582a1878e6db67400b0504a5099db85718d22c2e07f747fe1706ae7150" +dependencies = [ + "borsh 0.9.3", + "serde", +] + +[[package]] +name = "near-account-id" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d924011380de759c3dc6fdbcda37a19a5c061f56dab69d28a34ecee765e23e4" +dependencies = [ + "borsh 0.9.3", + "serde", +] + +[[package]] +name = "near-chain-configs" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1faf676a95bd1718b06e5957e01a9415fedf7900f32d94d5bcf70abd678b10a2" +dependencies = [ + "anyhow", + "chrono", + "derive_more", + "near-crypto 0.15.0", + "near-primitives 0.15.0", + "num-rational 0.3.2", + "serde", + "serde_json", + "sha2 0.10.7", + "smart-default", + "tracing", +] + +[[package]] +name = "near-crypto" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e75673d69fd7365508f3d32483669fe45b03bfb34e4d9363e90adae9dfb416c" +dependencies = [ + "arrayref", + "blake2", + "borsh 0.9.3", + "bs58", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "near-account-id 0.14.0", + "once_cell", + "parity-secp256k1", + "primitive-types 0.10.1", + "rand 0.7.3", + "rand_core 0.5.1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-crypto" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7754612b47737d277fb818e9fdbb1406e90f9e57151c55c3584d714421976cb6" +dependencies = [ + "arrayref", + "blake2", + "borsh 0.9.3", + "bs58", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "near-account-id 0.15.0", + "once_cell", + "primitive-types 0.10.1", + "rand 0.7.3", + "secp256k1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1335ffce1476da6516dcd22b26cece1a495fc725c0e8fec1879073752ac068d" +dependencies = [ + "borsh 0.9.3", + "lazy_static", + "log", + "near-chain-configs", + "near-crypto 0.15.0", + "near-jsonrpc-primitives", + "near-primitives 0.15.0", + "reqwest", + "serde", + "serde_json", + "thiserror", + "uuid", +] + +[[package]] +name = "near-jsonrpc-primitives" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada226c74f05508c516f109a97b9f23335120d0bfda208f0d187b6bbfe6eef5a" +dependencies = [ + "near-chain-configs", + "near-crypto 0.15.0", + "near-primitives 0.15.0", + "near-rpc-error-macro 0.15.0", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "near-primitives" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" +dependencies = [ + "borsh 0.9.3", + "byteorder", + "bytesize", + "chrono", + "derive_more", + "easy-ext", + "hex 0.4.3", + "near-crypto 0.14.0", + "near-primitives-core 0.14.0", + "near-rpc-error-macro 0.14.0", + "near-vm-errors 0.14.0", + "num-rational 0.3.2", + "once_cell", + "primitive-types 0.10.1", + "rand 0.7.3", + "reed-solomon-erasure", + "serde", + "serde_json", + "smart-default", + "strum", + "thiserror", +] + +[[package]] +name = "near-primitives" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97670b302dce15f09bba50f24c67aa08130fd01528cc61d4415892401e88e974" +dependencies = [ + "borsh 0.9.3", + "byteorder", + "bytesize", + "cfg-if 1.0.0", + "chrono", + "derive_more", + "easy-ext", + "hex 0.4.3", + "near-crypto 0.15.0", + "near-primitives-core 0.15.0", + "near-rpc-error-macro 0.15.0", + "near-vm-errors 0.15.0", + "num-rational 0.3.2", + "once_cell", + "primitive-types 0.10.1", + "rand 0.7.3", + "reed-solomon-erasure", + "serde", + "serde_json", + "smart-default", + "strum", + "thiserror", +] + +[[package]] +name = "near-primitives-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d508f0fc340f6461e4e256417685720d3c4c00bb5a939b105160e49137caba" +dependencies = [ + "base64 0.11.0", + "borsh 0.9.3", + "bs58", + "derive_more", + "near-account-id 0.14.0", + "num-rational 0.3.2", + "serde", + "sha2 0.10.7", + "strum", +] + +[[package]] +name = "near-primitives-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7929e19d862221949734c4a0063a8f55e7069de3a2ebc2d4f4c13497a5e953cb" +dependencies = [ + "base64 0.13.1", + "borsh 0.9.3", + "bs58", + "derive_more", + "near-account-id 0.15.0", + "num-rational 0.3.2", + "serde", + "serde_repr", + "sha2 0.10.7", + "strum", +] + +[[package]] +name = "near-rpc-error-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ee0b41c75ef859c193a8ff1dadfa0c8207bc0ac447cc22259721ad769a1408" +dependencies = [ + "quote", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "near-rpc-error-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36addf90cc04bd547a627b3a292f59d7de4dd6fb5042115419ae901b93ce6c2d" +dependencies = [ + "quote", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e837bd4bacd807073ec5ceb85708da7f721b46a4c2a978de86027fb0034ce31" +dependencies = [ + "near-rpc-error-core 0.14.0", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5beb352f3b91d8c491646c2fa4fdbbbf463c7b9c0226951c28f0197de44f99" +dependencies = [ + "near-rpc-error-core 0.15.0", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "near-sandbox-utils" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7479b0a2c52890000d410c6e4ba4f851334280530fa7446b78bcaf4683fe69b0" +dependencies = [ + "anyhow", + "async-process", + "binary-install", + "chrono", + "fs2", + "hex 0.3.2", + "home", +] + +[[package]] +name = "near-sdk" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15eb3de2defe3626260cc209a6cdb985c6b27b0bd4619fad97dcfae002c3c5bd" +dependencies = [ + "base64 0.13.1", + "borsh 0.9.3", + "bs58", + "near-abi", + "near-crypto 0.14.0", + "near-primitives 0.14.0", + "near-primitives-core 0.14.0", + "near-sdk-macros", + "near-sys", + "near-vm-logic", + "once_cell", + "schemars", + "serde", + "serde_json", + "wee_alloc", +] + +[[package]] +name = "near-sdk-macros" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4907affc9f5ed559456509188ff0024f1f2099c0830e6bdb66eb61d5b75912c0" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "near-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e307313276eaeced2ca95740b5639e1f3125b7c97f0a1151809d105f1aa8c6d3" + +[[package]] +name = "near-vm-errors" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0da466a30f0446639cbd788c30865086fac3e8dcb07a79e51d2b0775ed4261e" +dependencies = [ + "borsh 0.9.3", + "near-account-id 0.14.0", + "near-rpc-error-macro 0.14.0", + "serde", +] + +[[package]] +name = "near-vm-errors" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5591c9c8afa83a040cb5c3f29bc52b2efae2c32d4bcaee1bba723738da1a5cf6" +dependencies = [ + "borsh 0.9.3", + "near-account-id 0.15.0", + "near-rpc-error-macro 0.15.0", + "serde", + "strum", +] + +[[package]] +name = "near-vm-logic" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b534828419bacbf1f7b11ef7b00420f248c548c485d3f0cfda8bb6931152f2" +dependencies = [ + "base64 0.13.1", + "borsh 0.9.3", + "bs58", + "byteorder", + "near-account-id 0.14.0", + "near-crypto 0.14.0", + "near-primitives 0.14.0", + "near-primitives-core 0.14.0", + "near-vm-errors 0.14.0", + "ripemd", + "serde", + "sha2 0.10.7", + "sha3", + "zeropool-bn", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint 0.4.3", + "num-complex", + "num-integer", + "num-iter", + "num-rational 0.4.1", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint 0.4.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" +dependencies = [ + "bitflags 1.3.2", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.4", + "bitvec 0.20.4", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 2.3.1", + "serde", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +dependencies = [ + "arrayvec 0.7.4", + "bitvec 1.0.1", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 3.6.4", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-secp256k1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fca4f82fccae37e8bbdaeb949a4a218a1bbc485d11598f193d2a908042e5fc1" +dependencies = [ + "arrayvec 0.5.2", + "cc", + "cfg-if 0.1.10", + "rand 0.7.3", +] + +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if 1.0.0", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys", +] + +[[package]] +name = "portpicker" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be97d76faf1bfab666e1375477b23fde79eccf0276e9b63b92a39d676a889ba9" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash 0.7.0", + "impl-codec 0.5.1", + "uint", +] + +[[package]] +name = "primitive-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +dependencies = [ + "fixed-hash 0.8.0", + "impl-codec 0.6.0", + "impl-rlp", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +dependencies = [ + "getrandom 0.1.16", + "redox_syscall 0.1.57", + "rust-argon2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.10", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "reed-solomon-erasure" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a415a013dd7c5d4221382329a5a3482566da675737494935cbbbcdec04662f9d" +dependencies = [ + "smallvec", +] + +[[package]] +name = "regex" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64 0.21.2", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rlp-derive", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust-argon2" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +dependencies = [ + "base64 0.13.1", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys", +] + +[[package]] +name = "rustix" +version = "0.38.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.5", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "scale-info" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +dependencies = [ + "bitvec 1.0.1", + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec 3.6.4", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "schemars" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "rand 0.8.5", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" + +[[package]] +name = "serde" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "silo-to-silo-integration-tests" +version = "0.1.0" +dependencies = [ + "aurora-sdk-integration-tests", + "serde", + "serde_json", +] + +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "smart-default" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +dependencies = [ + "cfg-if 1.0.0", + "fastrand 2.0.0", + "redox_syscall 0.3.5", + "rustix 0.38.7", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +dependencies = [ + "autocfg", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" + +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap 2.0.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "triehash" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" +dependencies = [ + "hash-db", + "rlp", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex 0.4.3", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.28", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "workspaces" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b13d249618f197811e3673decc81459730cf5cc09ee7246dc4bede1e9333bc" +dependencies = [ + "async-process", + "async-trait", + "base64 0.13.1", + "borsh 0.9.3", + "bs58", + "chrono", + "dirs 3.0.2", + "hex 0.4.3", + "libc", + "near-account-id 0.15.0", + "near-crypto 0.15.0", + "near-jsonrpc-client", + "near-jsonrpc-primitives", + "near-primitives 0.15.0", + "near-sandbox-utils", + "portpicker", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-retry", + "tracing", + "url", +] + +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xattr" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +dependencies = [ + "libc", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "zeropool-bn" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" +dependencies = [ + "borsh 0.9.3", + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + +[[package]] +name = "zip" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "flate2", + "thiserror", + "time", +] diff --git a/silo-to-silo/integration-tests/Cargo.toml b/silo-to-silo/integration-tests/Cargo.toml new file mode 100644 index 00000000..3b0eb3e0 --- /dev/null +++ b/silo-to-silo/integration-tests/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "silo-to-silo-integration-tests" +version = "0.1.0" +edition = "2021" + +[dependencies] +aurora-sdk-integration-tests = { git = "https://github.com/aurora-is-near/aurora-contracts-sdk.git", branch = "silo" } +serde = {version = "1", features = ["derive"] } +serde_json = "1" diff --git a/silo-to-silo/integration-tests/aurora-contracts-sdk b/silo-to-silo/integration-tests/aurora-contracts-sdk new file mode 160000 index 00000000..62756e68 --- /dev/null +++ b/silo-to-silo/integration-tests/aurora-contracts-sdk @@ -0,0 +1 @@ +Subproject commit 62756e684e81c50ccce3c26758875bc318dde8df diff --git a/silo-to-silo/integration-tests/mock_token/Cargo.lock b/silo-to-silo/integration-tests/mock_token/Cargo.lock new file mode 100644 index 00000000..b86e6865 --- /dev/null +++ b/silo-to-silo/integration-tests/mock_token/Cargo.lock @@ -0,0 +1,1548 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytesize" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" + +[[package]] +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" +dependencies = [ + "cipher", + "ppv-lite86", +] + +[[package]] +name = "cc" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "dyn-clone" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" + +[[package]] +name = "easy-ext" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "impl-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mock_token" +version = "0.0.1" +dependencies = [ + "near-contract-standards", + "near-sdk", +] + +[[package]] +name = "near-abi" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "885db39b08518fa700b73fa2214e8adbbfba316ba82dd510f50519173eadaf73" +dependencies = [ + "borsh", + "schemars", + "semver", + "serde", +] + +[[package]] +name = "near-account-id" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d258582a1878e6db67400b0504a5099db85718d22c2e07f747fe1706ae7150" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "near-contract-standards" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bacc932e79b26472797adfb21689294b6f90960d1570daaf1e0b682b59fcb35" +dependencies = [ + "near-sdk", + "schemars", + "serde", + "serde_json", +] + +[[package]] +name = "near-crypto" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e75673d69fd7365508f3d32483669fe45b03bfb34e4d9363e90adae9dfb416c" +dependencies = [ + "arrayref", + "blake2", + "borsh", + "bs58", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "near-account-id", + "once_cell", + "parity-secp256k1", + "primitive-types", + "rand 0.7.3", + "rand_core 0.5.1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-primitives" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" +dependencies = [ + "borsh", + "byteorder", + "bytesize", + "chrono", + "derive_more", + "easy-ext", + "hex", + "near-crypto", + "near-primitives-core", + "near-rpc-error-macro", + "near-vm-errors", + "num-rational", + "once_cell", + "primitive-types", + "rand 0.7.3", + "reed-solomon-erasure", + "serde", + "serde_json", + "smart-default", + "strum", + "thiserror", +] + +[[package]] +name = "near-primitives-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d508f0fc340f6461e4e256417685720d3c4c00bb5a939b105160e49137caba" +dependencies = [ + "base64 0.11.0", + "borsh", + "bs58", + "derive_more", + "near-account-id", + "num-rational", + "serde", + "sha2 0.10.7", + "strum", +] + +[[package]] +name = "near-rpc-error-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ee0b41c75ef859c193a8ff1dadfa0c8207bc0ac447cc22259721ad769a1408" +dependencies = [ + "quote", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e837bd4bacd807073ec5ceb85708da7f721b46a4c2a978de86027fb0034ce31" +dependencies = [ + "near-rpc-error-core", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "near-sdk" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15eb3de2defe3626260cc209a6cdb985c6b27b0bd4619fad97dcfae002c3c5bd" +dependencies = [ + "base64 0.13.1", + "borsh", + "bs58", + "near-abi", + "near-crypto", + "near-primitives", + "near-primitives-core", + "near-sdk-macros", + "near-sys", + "near-vm-logic", + "once_cell", + "schemars", + "serde", + "serde_json", + "wee_alloc", +] + +[[package]] +name = "near-sdk-macros" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4907affc9f5ed559456509188ff0024f1f2099c0830e6bdb66eb61d5b75912c0" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "near-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e307313276eaeced2ca95740b5639e1f3125b7c97f0a1151809d105f1aa8c6d3" + +[[package]] +name = "near-vm-errors" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0da466a30f0446639cbd788c30865086fac3e8dcb07a79e51d2b0775ed4261e" +dependencies = [ + "borsh", + "near-account-id", + "near-rpc-error-macro", + "serde", +] + +[[package]] +name = "near-vm-logic" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b534828419bacbf1f7b11ef7b00420f248c548c485d3f0cfda8bb6931152f2" +dependencies = [ + "base64 0.13.1", + "borsh", + "bs58", + "byteorder", + "near-account-id", + "near-crypto", + "near-primitives", + "near-primitives-core", + "near-vm-errors", + "ripemd", + "serde", + "sha2 0.10.7", + "sha3", + "zeropool-bn", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-secp256k1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fca4f82fccae37e8bbdaeb949a4a218a1bbc485d11598f193d2a908042e5fc1" +dependencies = [ + "arrayvec 0.5.2", + "cc", + "cfg-if 0.1.10", + "rand 0.7.3", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "reed-solomon-erasure" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a415a013dd7c5d4221382329a5a3482566da675737494935cbbbcdec04662f9d" +dependencies = [ + "smallvec", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "schemars" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" + +[[package]] +name = "serde" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "smart-default" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" + +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.28", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" +dependencies = [ + "memchr", +] + +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "zeropool-bn" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" +dependencies = [ + "borsh", + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] diff --git a/silo-to-silo/integration-tests/mock_token/Cargo.toml b/silo-to-silo/integration-tests/mock_token/Cargo.toml new file mode 100644 index 00000000..707b8a5d --- /dev/null +++ b/silo-to-silo/integration-tests/mock_token/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "mock_token" +version = "0.0.1" +authors = ["mark.ts@blaize.tech", "tymofii.s@blaize.tech"] +edition = "2021" +publish = false + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +near-sdk = "4.1.1" +near-contract-standards = "4.1.1" diff --git a/silo-to-silo/integration-tests/mock_token/rust-toolchain b/silo-to-silo/integration-tests/mock_token/rust-toolchain new file mode 100644 index 00000000..2f3cf789 --- /dev/null +++ b/silo-to-silo/integration-tests/mock_token/rust-toolchain @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.66.1" +components = ["clippy", "rustfmt"] diff --git a/silo-to-silo/integration-tests/mock_token/src/lib.rs b/silo-to-silo/integration-tests/mock_token/src/lib.rs new file mode 100644 index 00000000..61c6ca9c --- /dev/null +++ b/silo-to-silo/integration-tests/mock_token/src/lib.rs @@ -0,0 +1,281 @@ +use near_contract_standards::fungible_token::metadata::{ + FungibleTokenMetadata, FungibleTokenMetadataProvider, FT_METADATA_SPEC, +}; +use near_contract_standards::fungible_token::FungibleToken; +use near_contract_standards::storage_management::{ + StorageBalance, StorageBalanceBounds, StorageManagement, +}; +use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; +use near_sdk::collections::LazyOption; +use near_sdk::json_types::U128; +use near_sdk::{env, near_bindgen, AccountId, PanicOnDefault, PromiseOrValue}; +use near_sdk::{log, require, Balance, Promise}; + +#[near_bindgen] +#[derive(BorshSerialize, BorshDeserialize, PanicOnDefault)] +pub struct Contract { + token: FungibleToken, + metadata: LazyOption, + storage_deposit: Option, +} + +// example from near +const DATA_IMAGE_SVG_NEAR_ICON: &str = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 288 288'%3E%3Cg id='l' data-name='l'%3E%3Cpath d='M187.58,79.81l-30.1,44.69a3.2,3.2,0,0,0,4.75,4.2L191.86,103a1.2,1.2,0,0,1,2,.91v80.46a1.2,1.2,0,0,1-2.12.77L102.18,77.93A15.35,15.35,0,0,0,90.47,72.5H87.34A15.34,15.34,0,0,0,72,87.84V201.16A15.34,15.34,0,0,0,87.34,216.5h0a15.35,15.35,0,0,0,13.08-7.31l30.1-44.69a3.2,3.2,0,0,0-4.75-4.2L96.14,186a1.2,1.2,0,0,1-2-.91V104.61a1.2,1.2,0,0,1,2.12-.77l89.55,107.23a15.35,15.35,0,0,0,11.71,5.43h3.13A15.34,15.34,0,0,0,216,201.16V87.84A15.34,15.34,0,0,0,200.66,72.5h0A15.35,15.35,0,0,0,187.58,79.81Z'/%3E%3C/g%3E%3C/svg%3E"; + +#[near_bindgen] +impl Contract { + #[init] + pub fn new_default_meta( + owner_id: AccountId, + name: String, + symbol: String, + total_supply: U128, + storage_deposit: Option, + ) -> Self { + Self::new( + owner_id, + total_supply, + FungibleTokenMetadata { + spec: FT_METADATA_SPEC.to_string(), + name, + symbol, + icon: Some(DATA_IMAGE_SVG_NEAR_ICON.to_string()), + reference: None, + reference_hash: None, + decimals: 24, + }, + storage_deposit, + ) + } + + #[init] + pub fn new( + owner_id: AccountId, + total_supply: U128, + metadata: FungibleTokenMetadata, + storage_deposit: Option, + ) -> Self { + require!(!env::state_exists(), "Already initialized"); + + metadata.assert_valid(); + let mut this = Self { + token: FungibleToken::new(b"a".to_vec()), + metadata: LazyOption::new(b"m".to_vec(), Some(&metadata)), + storage_deposit, + }; + this.token.internal_register_account(&owner_id); + this.token.internal_deposit(&owner_id, total_supply.into()); + this + } + + pub fn mint(&mut self, account_id: AccountId, amount: U128) { + if self.token.accounts.get(&account_id).is_none() { + self.token.internal_register_account(&account_id); + }; + + self.token.internal_deposit(&account_id, amount.into()); + } + + pub fn burn(&mut self, account_id: AccountId, amount: U128) { + self.token.internal_withdraw(&account_id, amount.into()); + } +} + +// main implementation for token and storage +near_contract_standards::impl_fungible_token_core!(Contract, token); + +#[near_bindgen] +impl FungibleTokenMetadataProvider for Contract { + fn ft_metadata(&self) -> FungibleTokenMetadata { + self.metadata.get().unwrap() + } +} + +#[near_bindgen] +impl StorageManagement for Contract { + #[payable] + fn storage_deposit( + &mut self, + account_id: Option, + #[allow(unused_variables)] registration_only: Option, + ) -> StorageBalance { + let amount: Balance = env::attached_deposit(); + let account_id = account_id.unwrap_or_else(env::predecessor_account_id); + if self.token.accounts.contains_key(&account_id) { + log!("The account is already registered, refunding the deposit"); + if amount > 0 { + Promise::new(env::predecessor_account_id()).transfer(amount); + } + } else { + let min_balance = self.storage_balance_bounds().min.0; + if amount < min_balance { + env::panic_str("The attached deposit is less than the minimum storage balance"); + } + + self.token.internal_register_account(&account_id); + let refund = amount - min_balance; + if refund > 0 { + Promise::new(env::predecessor_account_id()).transfer(refund); + } + } + self.token.storage_balance_of(account_id).unwrap() + } + + #[payable] + fn storage_withdraw(&mut self, amount: Option) -> StorageBalance { + self.token.storage_withdraw(amount) + } + + #[payable] + fn storage_unregister(&mut self, force: Option) -> bool { + #[allow(unused_variables)] + if let Some((account_id, balance)) = self.token.internal_storage_unregister(force) { + true + } else { + false + } + } + + fn storage_balance_bounds(&self) -> StorageBalanceBounds { + if let Some(storage_deposit) = self.storage_deposit { + StorageBalanceBounds { + min: storage_deposit, + max: Some(storage_deposit), + } + } else { + self.token.storage_balance_bounds() + } + } + + fn storage_balance_of(&self, account_id: AccountId) -> Option { + self.token.storage_balance_of(account_id) + } +} + +#[cfg(test)] +mod tests { + use near_sdk::test_utils::test_env::{alice, bob}; + use near_sdk::test_utils::{accounts, VMContextBuilder}; + use near_sdk::{env, testing_env, Balance}; + + use super::*; + + const TOTAL_SUPPLY: Balance = 1_000_000_000_000_000; + + fn init() -> (VMContextBuilder, AccountId, Contract) { + // get VM builer + let context = VMContextBuilder::new(); + // account for contract + let contract_account = alice(); + // init the contract + let contract = Contract::new_default_meta( + contract_account.clone(), + String::from("Mock Token"), + String::from("MOCK"), + TOTAL_SUPPLY.into(), + ); + (context, contract_account, contract) + } + + fn get_context(predecessor_account_id: AccountId) -> VMContextBuilder { + let mut builder = VMContextBuilder::new(); + builder + .current_account_id(accounts(0)) + .signer_account_id(predecessor_account_id.clone()) + .predecessor_account_id(predecessor_account_id); + builder + } + + #[test] + fn check_total_supply() { + let (context, _contract_account, contract) = init(); + testing_env!(context.build()); + assert_eq!(contract.ft_total_supply(), 1_000_000_000_000_000.into()); + } + + #[test] + fn test_mint_bob() { + let (context, _, mut contract) = init(); + testing_env!(context.build()); + let bob_account = bob(); + contract.mint(bob_account.clone(), (TOTAL_SUPPLY / 100).into()); + assert_eq!( + contract.ft_balance_of(bob_account), + (TOTAL_SUPPLY / 100).into() + ) + } + + #[test] + fn test_burn_bob() { + let (context, _, mut contract) = init(); + testing_env!(context.build()); + let bob_account = bob(); + contract.mint(bob_account.clone(), (TOTAL_SUPPLY / 100).into()); + contract.burn(bob_account.clone(), (TOTAL_SUPPLY / 100).into()); + assert_eq!(contract.ft_balance_of(bob_account), 0.into()) + } + + #[test] + fn test_transfer() { + let mut context = get_context(accounts(2)); + testing_env!(context.build()); + let mut contract = Contract::new_default_meta( + accounts(2), + String::from("Mock Token"), + String::from("MOCK"), + TOTAL_SUPPLY.into(), + ); + testing_env!(context + .storage_usage(env::storage_usage()) + .attached_deposit(contract.storage_balance_bounds().min.into()) + .predecessor_account_id(accounts(1)) + .build()); + // Paying for account registration, aka storage deposit + contract.storage_deposit(None, None); + + testing_env!(context + .storage_usage(env::storage_usage()) + .attached_deposit(1) + .predecessor_account_id(accounts(2)) + .build()); + + let transferred_tokens = TOTAL_SUPPLY / 100; + contract.ft_transfer( + accounts(1), + transferred_tokens.into(), + Some("you have received some tokens ".to_string()), + ); + + testing_env!(context + .storage_usage(env::storage_usage()) + .account_balance(env::account_balance()) + .is_view(true) + .attached_deposit(0) + .build()); + + assert_eq!( + contract.ft_balance_of(accounts(2)).0, + (TOTAL_SUPPLY - transferred_tokens) + ); + assert_eq!(contract.ft_balance_of(accounts(1)).0, transferred_tokens); + } + + #[test] + fn test_ft_metadata() { + let context = get_context(accounts(2)); + testing_env!(context.build()); + let contract = Contract::new_default_meta( + accounts(2), + String::from("Mock Token"), + String::from("MOCK"), + TOTAL_SUPPLY.into(), + ); + let some_metadata = contract.ft_metadata(); + let contract_metadata = contract.metadata.get().unwrap(); + assert_eq!(some_metadata.spec, contract_metadata.spec); + assert_eq!(some_metadata.name, contract_metadata.name); + assert_eq!(some_metadata.symbol, contract_metadata.symbol); + assert_eq!(some_metadata.icon, contract_metadata.icon); + assert_eq!(some_metadata.decimals, contract_metadata.decimals); + } +} diff --git a/silo-to-silo/integration-tests/rust-toolchain b/silo-to-silo/integration-tests/rust-toolchain new file mode 100644 index 00000000..2f3cf789 --- /dev/null +++ b/silo-to-silo/integration-tests/rust-toolchain @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.66.1" +components = ["clippy", "rustfmt"] diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs new file mode 100644 index 00000000..0e34f296 --- /dev/null +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -0,0 +1,885 @@ +#[cfg(test)] +mod tests { + use aurora_sdk_integration_tests::aurora_engine::erc20::ERC20; + use aurora_sdk_integration_tests::aurora_engine_types::parameters::engine::{ + SubmitResult, TransactionStatus, + }; + use aurora_sdk_integration_tests::aurora_engine_types::H160; + use aurora_sdk_integration_tests::wnear::Wnear; + use aurora_sdk_integration_tests::workspaces::network::Sandbox; + use aurora_sdk_integration_tests::workspaces::result::ExecutionFinalResult; + use aurora_sdk_integration_tests::workspaces::{Account, Contract, Worker}; + use aurora_sdk_integration_tests::{ + aurora_engine::{self, AuroraEngine}, + aurora_engine_types::{ + parameters::engine::{CallArgs, FunctionCallArgsV1}, + types::{Address, Wei}, + U256, + }, + ethabi, tokio, + utils::{ethabi::DeployedContract, forge}, + wnear, + workspaces::{self, AccountId}, + }; + use std::path::Path; + + const ATTACHED_NEAR: u128 = 5_000_000_000_000_000_000_000_000; + const NEAR_DEPOSIT: u128 = 2_000_000_000_000_000_000_000_000; + + const TRANSFER_TOKENS_AMOUNT: u64 = 100; + const TOKEN_SUPPLY: u64 = 1000000000; + + const NEP141_STORAGE_DEPOSIT: u128 = 12_500_000_000_000_000_000_000; + + struct TestsInfrastructure { + worker: Worker, + engine: AuroraEngine, + silo: AuroraEngine, + engine_wnear: Wnear, + silo_wnear: Wnear, + user_account: Account, + user_address: Address, + engine_silo_to_silo_contract: DeployedContract, + silo_silo_to_silo_contract: DeployedContract, + mock_token: Contract, + engine_mock_token: ERC20, + silo_mock_token: ERC20, + } + + impl TestsInfrastructure { + pub async fn init(storage_deposit: Option) -> Self { + let worker = workspaces::sandbox().await.unwrap(); + let engine = aurora_engine::deploy_latest_silo(&worker, "aurora.test.near") + .await + .unwrap(); + let silo = aurora_engine::deploy_latest_silo(&worker, "silo.test.near") + .await + .unwrap(); + + let engine_wnear = wnear::Wnear::deploy(&worker, &engine).await.unwrap(); + let silo_wnear = wnear::Wnear::deploy(&worker, &silo).await.unwrap(); + let user_account = worker.dev_create_account().await.unwrap(); + let user_address = + aurora_sdk_integration_tests::aurora_engine_sdk::types::near_account_to_evm_address( + user_account.id().as_bytes(), + ); + + let engine_silo_to_silo_contract = deploy_silo_to_silo_sol_contract( + &engine, + &user_account, + engine_wnear.aurora_token.address, + ) + .await; + + let mock_token = deploy_mock_token(&worker, user_account.id(), storage_deposit).await; + let engine_mock_token = engine.bridge_nep141(mock_token.id()).await.unwrap(); + let silo_mock_token = silo.bridge_nep141(mock_token.id()).await.unwrap(); + + let silo_silo_to_silo_contract = deploy_silo_to_silo_sol_contract( + &silo, + &user_account, + silo_wnear.aurora_token.address, + ) + .await; + + TestsInfrastructure { + worker: worker, + engine, + silo, + engine_wnear, + silo_wnear, + user_account, + user_address, + engine_silo_to_silo_contract, + silo_silo_to_silo_contract, + mock_token, + engine_mock_token, + silo_mock_token, + } + } + + pub async fn mint_wnear_engine(&self, user_address: Option
) { + self.engine + .mint_wnear( + &self.engine_wnear, + user_address.unwrap_or(self.user_address), + 2 * (ATTACHED_NEAR + NEAR_DEPOSIT), + ) + .await + .unwrap(); + } + + pub async fn mint_wnear_silo(&self) { + self.silo + .mint_wnear( + &self.silo_wnear, + self.user_address, + 2 * (ATTACHED_NEAR + NEAR_DEPOSIT), + ) + .await + .unwrap(); + } + + pub async fn approve_spend_wnear_engine(&self, user_account: Option) { + approve_spend_tokens( + &self.engine_wnear.aurora_token, + self.engine_silo_to_silo_contract.address, + &user_account.unwrap_or(self.user_account.clone()), + &self.engine, + ) + .await; + } + + pub async fn silo_to_silo_register_token_engine( + &self, + user_account: Option, + check_result: bool, + ) { + silo_to_silo_register_token( + &self.engine_silo_to_silo_contract, + self.engine_mock_token.address.raw(), + self.mock_token.id().to_string(), + &user_account.unwrap_or(self.user_account.clone()), + &self.engine, + check_result, + ) + .await; + } + + pub async fn silo_to_silo_register_token_silo(&self) { + silo_to_silo_register_token( + &self.silo_silo_to_silo_contract, + self.silo_mock_token.address.raw(), + self.mock_token.id().to_string(), + &self.user_account, + &self.silo, + true, + ) + .await; + } + + pub async fn check_token_is_regester_engine(&self, expected_result: bool) { + check_token_account_id( + &self.engine_silo_to_silo_contract, + self.engine_mock_token.address.raw(), + self.mock_token.id().to_string(), + &self.user_account, + &self.engine, + expected_result, + ) + .await; + } + + pub async fn approve_spend_mock_tokens_engine(&self) { + approve_spend_tokens( + &self.engine_mock_token, + self.engine_silo_to_silo_contract.address, + &self.user_account, + &self.engine, + ) + .await; + } + + pub async fn get_mock_token_balance_engine(&self) -> U256 { + self.engine + .erc20_balance_of(&self.engine_mock_token, self.user_address) + .await + .unwrap() + } + + pub async fn get_mock_token_balance_silo(&self) -> U256 { + self.silo + .erc20_balance_of(&self.silo_mock_token, self.user_address) + .await + .unwrap() + } + + pub async fn engine_to_silo_transfer(&self, check_output: bool) { + silo_to_silo_transfer( + &self.engine_silo_to_silo_contract, + &self.engine_mock_token, + self.engine.inner.id(), + self.silo.inner.id(), + self.user_account.clone(), + self.user_address.encode(), + check_output, + ) + .await; + } + + pub async fn silo_to_engine_transfer(&self) { + silo_to_silo_transfer( + &self.silo_silo_to_silo_contract, + &self.silo_mock_token, + self.silo.inner.id(), + self.engine.inner.id(), + self.user_account.clone(), + self.user_address.encode(), + true, + ) + .await; + } + + pub async fn approve_spend_tokens_silo(&self) { + approve_spend_tokens( + &self.silo_mock_token, + self.silo_silo_to_silo_contract.address, + &self.user_account, + &self.silo, + ) + .await; + } + + pub async fn check_token_account_id_silo(&self) { + check_token_account_id( + &self.silo_silo_to_silo_contract, + self.silo_mock_token.address.raw(), + self.mock_token.id().to_string(), + &self.user_account, + &self.silo, + true, + ) + .await; + } + + pub async fn approve_spend_wnear_silo(&self) { + approve_spend_tokens( + &self.silo_wnear.aurora_token, + self.silo_silo_to_silo_contract.address, + &self.user_account, + &self.silo, + ) + .await; + } + + pub async fn check_user_balance_engine(&self, expected_value: u8) { + check_get_user_balance( + &self.engine_silo_to_silo_contract, + &self.user_account, + self.engine_mock_token.address.raw(), + self.user_address.raw(), + &self.engine, + expected_value, + ) + .await; + } + + pub async fn call_ft_transfer_call_callback_engine(&self, user_account: Account) { + let contract_args = self + .engine_silo_to_silo_contract + .create_call_method_bytes_with_args( + "ftTransferCallCallback", + &[ + ethabi::Token::Address(self.user_address.raw()), + ethabi::Token::Address(self.engine_mock_token.address.raw()), + ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), + ], + ); + + call_aurora_contract( + self.engine_silo_to_silo_contract.address, + contract_args, + &user_account, + self.engine.inner.id(), + true, + ) + .await + .unwrap(); + } + } + + #[tokio::test] + async fn test_ft_transfer_to_silo() { + let infra = TestsInfrastructure::init(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + + infra.mint_wnear_engine(None).await; + infra.approve_spend_wnear_engine(None).await; + + infra.silo_to_silo_register_token_engine(None, true).await; + infra.check_token_is_regester_engine(true).await; + check_near_account_id( + &infra.engine_silo_to_silo_contract, + &infra.user_account, + &infra.engine, + ) + .await; + + storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; + storage_deposit(&infra.mock_token, infra.silo.inner.id(), None).await; + + engine_mint_tokens(infra.user_address, &infra.engine_mock_token, &infra.engine).await; + infra.approve_spend_mock_tokens_engine().await; + + let balance_engine_before = infra.get_mock_token_balance_engine().await; + infra.engine_to_silo_transfer(true).await; + + let balance_engine_after = infra.get_mock_token_balance_engine().await; + assert_eq!( + (balance_engine_before - balance_engine_after).as_u64(), + TRANSFER_TOKENS_AMOUNT + ); + + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), TRANSFER_TOKENS_AMOUNT); + + // Transfer from silo back to aurora + infra.mint_wnear_silo().await; + infra.approve_spend_wnear_silo().await; + + infra.silo_to_silo_register_token_silo().await; + infra.check_token_account_id_silo().await; + + infra.approve_spend_tokens_silo().await; + infra.silo_to_engine_transfer().await; + + let balance_engine_after_silo = infra.get_mock_token_balance_engine().await; + assert_eq!( + (balance_engine_after_silo - balance_engine_after).as_u64(), + TRANSFER_TOKENS_AMOUNT + ); + + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), 0); + } + + #[tokio::test] + async fn test_withdraw() { + let infra = TestsInfrastructure::init(None).await; + infra.mint_wnear_engine(None).await; + infra.approve_spend_wnear_engine(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + + infra.silo_to_silo_register_token_engine(None, true).await; + infra.check_token_is_regester_engine(true).await; + check_near_account_id( + &infra.engine_silo_to_silo_contract, + &infra.user_account, + &infra.engine, + ) + .await; + + storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; + + engine_mint_tokens(infra.user_address, &infra.engine_mock_token, &infra.engine).await; + infra.approve_spend_mock_tokens_engine().await; + + let balance_engine_before = infra.get_mock_token_balance_engine().await; + infra.engine_to_silo_transfer(false).await; + + let balance_engine_after = infra.get_mock_token_balance_engine().await; + + assert_eq!( + (balance_engine_before - balance_engine_after).as_u64(), + TRANSFER_TOKENS_AMOUNT + ); + + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), 0); + + infra.check_user_balance_engine(100).await; + withdraw( + &infra.engine_silo_to_silo_contract, + &infra.engine_mock_token, + infra.engine.inner.id(), + infra.user_account.clone(), + ) + .await; + + let balance_engine_after_withdraw = infra.get_mock_token_balance_engine().await; + assert_eq!(balance_engine_before, balance_engine_after_withdraw); + + infra.check_user_balance_engine(0).await; + } + + #[tokio::test] + async fn check_access_control() { + let infra = TestsInfrastructure::init(None).await; + //create new user + let regular_user_account = infra.worker.dev_create_account().await.unwrap(); + let regular_user_address = + aurora_sdk_integration_tests::aurora_engine_sdk::types::near_account_to_evm_address( + regular_user_account.id().as_bytes(), + ); + + //error on call registerToken by regular user + infra.mint_wnear_engine(Some(regular_user_address)).await; + infra + .approve_spend_wnear_engine(Some(regular_user_account.clone())) + .await; + + infra + .silo_to_silo_register_token_engine(Some(regular_user_account.clone()), true) + .await; + infra.check_token_is_regester_engine(false).await; + + //error on call registerToken by aurora account + let aurora_address = + aurora_sdk_integration_tests::aurora_engine_sdk::types::near_account_to_evm_address( + infra.engine.inner.id().as_bytes(), + ); + infra.mint_wnear_engine(Some(aurora_address)).await; + infra + .approve_spend_wnear_engine(Some(infra.engine.inner.as_account().clone())) + .await; + infra + .silo_to_silo_register_token_engine(Some(infra.engine.inner.as_account().clone()), true) + .await; + infra.check_token_is_regester_engine(false).await; + + //error on call ftTransferCallCallback by regular user + infra + .call_ft_transfer_call_callback_engine(regular_user_account.clone()) + .await; + infra.check_user_balance_engine(0).await; + + //error on call ftTransferCallCallback by admin + infra + .call_ft_transfer_call_callback_engine(infra.user_account.clone()) + .await; + infra.check_user_balance_engine(0).await; + + //error on call ftTransferCallCallback by aurora + infra + .call_ft_transfer_call_callback_engine(infra.engine.inner.as_account().clone()) + .await; + infra.check_user_balance_engine(0).await; + } + + #[tokio::test] + async fn transfer_not_register_tokens() { + let infra = TestsInfrastructure::init(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + infra.mint_wnear_engine(None).await; + infra.approve_spend_wnear_engine(None).await; + + infra.check_token_is_regester_engine(false).await; + + storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; + storage_deposit(&infra.mock_token, infra.silo.inner.id(), None).await; + + engine_mint_tokens(infra.user_address, &infra.engine_mock_token, &infra.engine).await; + infra.approve_spend_mock_tokens_engine().await; + + let balance_engine_before = infra.get_mock_token_balance_engine().await; + + infra.engine_to_silo_transfer(true).await; + + let balance_engine_after = infra.get_mock_token_balance_engine().await; + assert_eq!(balance_engine_before, balance_engine_after); + } + + #[ignore] + #[tokio::test] + async fn error_on_withdraw_to_near() { + let deposit_value = Some(10_000_000_000_000_000_000_000_000u128); + let infra = TestsInfrastructure::init(deposit_value).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + infra.mint_wnear_engine(None).await; + infra.approve_spend_wnear_engine(None).await; + + infra.silo_to_silo_register_token_engine(None, false).await; + infra.check_token_is_regester_engine(true).await; + + storage_deposit(&infra.mock_token, infra.engine.inner.id(), deposit_value).await; + storage_deposit(&infra.mock_token, infra.silo.inner.id(), deposit_value).await; + + engine_mint_tokens(infra.user_address, &infra.engine_mock_token, &infra.engine).await; + infra.approve_spend_mock_tokens_engine().await; + + let balance_engine_before = infra.get_mock_token_balance_engine().await; + + infra.engine_to_silo_transfer(false).await; + + let balance_engine_after = infra.get_mock_token_balance_engine().await; + + assert_eq!( + (balance_engine_before - balance_engine_after).as_u64(), + TRANSFER_TOKENS_AMOUNT + ); + + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), 0); + + infra + .check_user_balance_engine(TRANSFER_TOKENS_AMOUNT as u8) + .await; + + storage_deposit( + &infra.mock_token, + &(infra.engine_silo_to_silo_contract.address.encode() + + "." + + &infra.engine.inner.id().to_string()), + deposit_value, + ) + .await; + withdraw( + &infra.engine_silo_to_silo_contract, + &infra.engine_mock_token, + infra.engine.inner.id(), + infra.user_account.clone(), + ) + .await; + + let balance_engine_after_withdraw = infra.get_mock_token_balance_engine().await; + assert_eq!(balance_engine_before, balance_engine_after_withdraw); + + infra.check_user_balance_engine(0).await; + } + + async fn deploy_silo_to_silo_sol_contract( + engine: &AuroraEngine, + user_account: &workspaces::Account, + wnear_address: Address, + ) -> DeployedContract { + let aurora_sdk_path = Path::new("./aurora-contracts-sdk/aurora-solidity-sdk"); + assert!( + aurora_sdk_path.exists(), + "The path isn't exist: {}", + aurora_sdk_path.to_string_lossy() + ); + + let codec_lib = forge::deploy_codec_lib(&aurora_sdk_path, engine) + .await + .unwrap(); + let utils_lib = forge::deploy_utils_lib(&aurora_sdk_path, engine) + .await + .unwrap(); + let aurora_sdk_lib = + forge::deploy_aurora_sdk_lib(&aurora_sdk_path, engine, codec_lib, utils_lib) + .await + .unwrap(); + + let contract_path = Path::new("../contracts"); + let constructor = forge::forge_build( + contract_path, + &[ + format!( + "@auroraisnear/aurora-sdk/aurora-sdk/AuroraSdk.sol:AuroraSdk:0x{}", + aurora_sdk_lib.encode() + ), + format!( + "@auroraisnear/aurora-sdk/aurora-sdk/Utils.sol:Utils:0x{}", + utils_lib.encode() + ), + ], + &["out", "SiloToSilo.sol", "SiloToSilo.json"], + ) + .await + .unwrap(); + + let deploy_bytes = constructor.create_deploy_bytes_with_args(&[ + ethabi::Token::Address(wnear_address.raw()), + ethabi::Token::String(engine.inner.id().to_string()), + ]); + + let address = engine + .deploy_evm_contract_with(user_account, deploy_bytes) + .await + .unwrap(); + + constructor.deployed_at(address) + } + + async fn deploy_mock_token( + worker: &workspaces::Worker, + user_account_id: &str, + storage_deposit: Option, + ) -> workspaces::Contract { + let artifact_path = + Path::new("./mock_token/target/wasm32-unknown-unknown/release/mock_token.wasm"); + let wasm_bytes = tokio::fs::read(artifact_path).await.unwrap(); + let mock_token = worker.dev_deploy(&wasm_bytes).await.unwrap(); + + mock_token + .call("new_default_meta") + .args_json(serde_json::json!({"owner_id": user_account_id, "name": "MockToken", "symbol": "MCT", "total_supply": format!("{}", TOKEN_SUPPLY), "storage_deposit": storage_deposit.map(|x| format!("{}", x))})) + .transact() + .await + .unwrap() + .into_result() + .unwrap(); + + mock_token + } + + async fn mint_tokens_near(token_contract: &Contract, receiver_id: &str) { + token_contract + .call("mint") + .args_json(serde_json::json!({ + "account_id": receiver_id, + "amount": format!("{}", TOKEN_SUPPLY) + })) + .transact() + .await + .unwrap() + .into_result() + .unwrap(); + } + + async fn approve_spend_tokens( + token_contract: &ERC20, + spender_address: Address, + user_account: &Account, + engine: &AuroraEngine, + ) { + let evm_input = token_contract.create_approve_call_bytes(spender_address, U256::MAX); + let result = engine + .call_evm_contract_with(user_account, token_contract.address, evm_input, Wei::zero()) + .await + .unwrap(); + aurora_engine::unwrap_success(result.status).unwrap(); + } + + async fn silo_to_silo_register_token( + silo_to_silo_contract: &DeployedContract, + engine_mock_token_address: H160, + near_mock_token_account_id: String, + user_account: &Account, + engine: &AuroraEngine, + check_result: bool, + ) { + let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( + "registerToken", + &[ + ethabi::Token::Address(engine_mock_token_address), + ethabi::Token::String(near_mock_token_account_id), + ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), + ], + ); + + call_aurora_contract( + silo_to_silo_contract.address, + contract_args, + user_account, + engine.inner.id(), + check_result, + ) + .await + .unwrap(); + } + + async fn check_token_account_id( + silo_to_silo_contract: &DeployedContract, + engine_mock_token_address: H160, + near_mock_token_account_id: String, + user_account: &Account, + engine: &AuroraEngine, + expected_result: bool, + ) { + let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( + "getTokenAccountId", + &[ethabi::Token::Address(engine_mock_token_address)], + ); + + let outcome = call_aurora_contract( + silo_to_silo_contract.address, + contract_args, + user_account, + engine.inner.id(), + true, + ) + .await; + + let result = outcome.unwrap().borsh::().unwrap(); + if let TransactionStatus::Succeed(res) = result.status { + let str_res = std::str::from_utf8(&res).unwrap(); + assert_eq!( + str_res.contains(&near_mock_token_account_id), + expected_result + ); + } + } + + async fn check_near_account_id( + silo_to_silo_contract: &DeployedContract, + user_account: &Account, + engine: &AuroraEngine, + ) { + let contract_args = + silo_to_silo_contract.create_call_method_bytes_with_args("getNearAccountId", &[]); + + let outcome = call_aurora_contract( + silo_to_silo_contract.address, + contract_args, + user_account, + engine.inner.id(), + true, + ) + .await; + + let result = outcome.unwrap().borsh::().unwrap(); + if let TransactionStatus::Succeed(res) = result.status { + let str_res = std::str::from_utf8(&res).unwrap(); + assert!(str_res.contains(&silo_to_silo_contract.address.encode())); + } + } + + async fn check_get_user_balance( + silo_to_silo_contract: &DeployedContract, + user_account: &Account, + engine_mock_token_address: H160, + user_address: H160, + engine: &AuroraEngine, + expected_value: u8, + ) { + let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( + "getUserBalance", + &[ + ethabi::Token::Address(engine_mock_token_address), + ethabi::Token::Address(user_address), + ], + ); + let outcome = call_aurora_contract( + silo_to_silo_contract.address, + contract_args, + user_account, + engine.inner.id(), + true, + ) + .await; + + let result = outcome.unwrap().borsh::().unwrap(); + if let TransactionStatus::Succeed(res) = result.status { + assert_eq!(res[res.len() - 1], expected_value); + } + } + + async fn storage_deposit(token_contract: &Contract, account_id: &str, deposit: Option) { + let outcome = token_contract + .call("storage_deposit") + .args_json(serde_json::json!({ "account_id": account_id })) + .max_gas() + .deposit(deposit.unwrap_or(1_250_000_000_000_000_000_000)) + .transact() + .await + .unwrap(); + + assert!( + outcome.failures().is_empty(), + "Call to set failed: {:?}", + outcome.failures() + ); + } + + async fn engine_mint_tokens( + user_address: Address, + token_account: &ERC20, + engine: &AuroraEngine, + ) { + let mint_args = + token_account.create_mint_call_bytes(user_address, U256::from(TRANSFER_TOKENS_AMOUNT)); + let call_args = CallArgs::V1(FunctionCallArgsV1 { + contract: token_account.address, + input: mint_args.0, + }); + + let outcome = engine + .inner + .call("call") + .args_borsh(call_args) + .max_gas() + .transact() + .await + .unwrap(); + + assert!( + outcome.failures().is_empty(), + "Call to set failed: {:?}", + outcome.failures() + ); + + let balance = engine + .erc20_balance_of(&token_account, user_address) + .await + .unwrap(); + assert_eq!(balance.as_u64(), TRANSFER_TOKENS_AMOUNT); + } + + async fn silo_to_silo_transfer( + silo_to_silo_contract: &DeployedContract, + token_account: &ERC20, + silo1_address: &AccountId, + silo2_address: &AccountId, + user_account: Account, + user_address: String, + check_output: bool, + ) { + let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address(token_account.address.raw()), + ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), + ethabi::Token::String(silo2_address.to_string()), + ethabi::Token::String(user_address), + ], + ); + + call_aurora_contract( + silo_to_silo_contract.address, + contract_args, + &user_account, + silo1_address, + check_output, + ) + .await + .unwrap(); + } + + async fn withdraw( + silo_to_silo_contract: &DeployedContract, + token_account: &ERC20, + engine_address: &AccountId, + user_account: Account, + ) { + let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( + "withdraw", + &[ethabi::Token::Address(token_account.address.raw())], + ); + + call_aurora_contract( + silo_to_silo_contract.address, + contract_args, + &user_account, + engine_address, + true, + ) + .await + .unwrap(); + } + + async fn call_aurora_contract( + contract_address: Address, + contract_args: Vec, + user_account: &Account, + engine_account: &AccountId, + check_output: bool, + ) -> ExecutionFinalResult { + let call_args = CallArgs::V1(FunctionCallArgsV1 { + contract: contract_address, + input: contract_args, + }); + + let outcome = user_account + .call(engine_account, "call") + .args_borsh(call_args) + .max_gas() + .transact() + .await + .unwrap(); + + if check_output { + assert!( + outcome.failures().is_empty(), + "Call to set failed: {:?}", + outcome.failures() + ); + } + + outcome + } +} From c6f793ff0b10a6d2e2a6e993481e606cffbee22e Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 11 Aug 2023 18:39:33 +0100 Subject: [PATCH 04/50] Make `registerToken` trustless --- silo-to-silo/contracts/src/SiloToSilo.sol | 170 ++++++++++++++-------- silo-to-silo/integration-tests/src/lib.rs | 50 +++---- 2 files changed, 130 insertions(+), 90 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index a2dc3940..14053d5e 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -9,6 +9,11 @@ import "@openzeppelin/contracts/utils/Base64.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./IEvmErc20.sol"; +struct TokenInfo { + string nearTokenAccountId; + bool isStorageRegistered; +} + contract SiloToSilo is AccessControl { using AuroraSdk for NEAR; using AuroraSdk for PromiseCreateArgs; @@ -21,10 +26,10 @@ contract SiloToSilo is AccessControl { uint64 constant FT_TRANSFER_CALL_NEAR_GAS = 150_000_000_000_000; NEAR public near; - string siloAccountId; + string public siloAccountId; //[auroraErc20Token] => tokenAccountIdOnNear - mapping(IEvmErc20 => string) registeredTokens; + mapping(IEvmErc20 => TokenInfo) registeredTokens; //[auroraErc20Token][userAddressOnAurora] => userBalance mapping(IEvmErc20 => mapping(address => uint256)) balance; @@ -39,28 +44,65 @@ contract SiloToSilo is AccessControl { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } - // TODO: make it trustless - function registerToken( - IEvmErc20 token, - string memory nearTokenAccountId, - uint128 storageDepositAmount - ) public onlyRole(DEFAULT_ADMIN_ROLE) { - near.wNEAR.transferFrom(msg.sender, address(this), uint256(storageDepositAmount)); - bytes memory args = bytes( - string.concat('{"account_id": "', getNearAccountId(), '", "registration_only": true }') + function registerToken(IEvmErc20 token) external { + PromiseCreateArgs memory callGetNep141FromErc20 = near.call( + siloAccountId, + "get_nep141_from_erc20", + abi.encodePacked(address(token)), + 0, + BASE_NEAR_GAS ); + PromiseCreateArgs memory callback = near.auroraCall( + address(this), + abi.encodeWithSelector(this.getNep141FromErc20Callback.selector, token), + 0, + BASE_NEAR_GAS + ); + + callGetNep141FromErc20.then(callback).transact(); + } + + function getNep141FromErc20Callback(IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { + require( + AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, + "ERROR: The `get_nep141_from_erc20` XCC is fail" + ); + + string memory nearTokenAccountId = string(AuroraSdk.promiseResult(0).output); + registeredTokens[token] = TokenInfo(nearTokenAccountId, false); + emit TokenRegistered(token, nearTokenAccountId); + } + + function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external { + string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; + require(bytes(tokenAccountId).length > 0, "The token is not registered!"); + + near.wNEAR.transferFrom(msg.sender, address(this), uint256(storageDepositAmount)); + PromiseCreateArgs memory callStorageDeposit = near.call( - nearTokenAccountId, + tokenAccountId, "storage_deposit", - args, + bytes(string.concat('{"account_id": "', getNearAccountId(), '", "registration_only": true }')), storageDepositAmount, BASE_NEAR_GAS ); - callStorageDeposit.transact(); - registeredTokens[token] = nearTokenAccountId; - emit TokenRegistered(token, nearTokenAccountId); + PromiseCreateArgs memory callback = near.auroraCall( + address(this), + abi.encodeWithSelector(this.storageDepositCallback.selector, token), + 0, + BASE_NEAR_GAS + ); + callStorageDeposit.then(callback).transact(); + } + + function storageDepositCallback(IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { + require( + AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, + "ERROR: The `storage_deposit` XCC is fail" + ); + registeredTokens[token].isStorageRegistered = true; } function ftTransferCallToNear( @@ -69,8 +111,10 @@ contract SiloToSilo is AccessControl { string calldata receiverId, string calldata message ) external { - string storage tokenAccountId = registeredTokens[token]; - require(bytes(tokenAccountId).length > 0, "The token is not registered!"); + require(near.wNEAR.balanceOf(address(this)) > 0, "Not enough wNEAR balance"); + + TokenInfo storage tokenInfo = registeredTokens[token]; + require(tokenInfo.isStorageRegistered, "The token storage is not registered!"); token.transferFrom(msg.sender, address(this), amount); // WARNING: The `withdrawToNear` method works asynchronously. @@ -79,33 +123,35 @@ contract SiloToSilo is AccessControl { // We expect such an error not to happen as long as transactions were executed in one shard. token.withdrawToNear(bytes(getNearAccountId()), amount); - bytes memory args = bytes( - string.concat( - '{"receiver_id": "', - receiverId, - '", "amount": "', - Strings.toString(amount), - '", "msg": "', - message, - '"}' - ) - ); - PromiseCreateArgs memory callFtTransfer = near.call( - tokenAccountId, + tokenInfo.nearTokenAccountId, "ft_transfer_call", - args, + bytes( + string.concat( + '{"receiver_id": "', + receiverId, + '", "amount": "', + Strings.toString(amount), + '", "msg": "', + message, + '"}' + ) + ), 1, FT_TRANSFER_CALL_NEAR_GAS ); - - bytes memory callbackArg = abi.encodeWithSelector(this.ftTransferCallCallback.selector, msg.sender, token, amount); - PromiseCreateArgs memory callback = near.auroraCall(address(this), callbackArg, 0, BASE_NEAR_GAS); + + PromiseCreateArgs memory callback = near.auroraCall( + address(this), + abi.encodeWithSelector(this.ftTransferCallCallback.selector, msg.sender, token, amount), + 0, + BASE_NEAR_GAS + ); callFtTransfer.then(callback).transact(); } - function ftTransferCallCallback(address sender, IEvmErc20 token, uint256 amount) public onlyRole(CALLBACK_ROLE) { + function ftTransferCallCallback(address sender, IEvmErc20 token, uint256 amount) external onlyRole(CALLBACK_ROLE) { uint256 transferredAmount = 0; if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { @@ -116,37 +162,43 @@ contract SiloToSilo is AccessControl { } function withdraw(IEvmErc20 token) external { - string storage tokenAccountId = registeredTokens[token]; - uint256 senderBalance = balance[token][msg.sender]; + require(near.wNEAR.balanceOf(address(this)) > 0, "Not enough wNEAR balance"); + + string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; + require(bytes(tokenAccountId).length > 0, "The token is not registered!"); + uint256 senderBalance = balance[token][msg.sender]; require(senderBalance > 0, "The signer token balance = 0"); - near.wNEAR.transferFrom(msg.sender, address(this), uint256(1)); - bytes memory args = bytes( - string.concat( - '{"receiver_id": "', - siloAccountId, - '", "amount": "', - Strings.toString(senderBalance), - '", "msg": "', - _addressToString(msg.sender), - '"}' - ) - ); PromiseCreateArgs memory callWithdraw = near.call( tokenAccountId, "ft_transfer_call", - args, + bytes( + string.concat( + '{"receiver_id": "', + siloAccountId, + '", "amount": "', + Strings.toString(senderBalance), + '", "msg": "', + _addressToString(msg.sender), + '"}' + ) + ), 1, WITHDRAW_NEAR_GAS ); - bytes memory callbackArg = abi.encodeWithSelector(this.withdrawCallback.selector, msg.sender, token); - PromiseCreateArgs memory callback = near.auroraCall(address(this), callbackArg, 0, BASE_NEAR_GAS); + + PromiseCreateArgs memory callback = near.auroraCall( + address(this), + abi.encodeWithSelector(this.withdrawCallback.selector, msg.sender, token), + 0, + BASE_NEAR_GAS + ); callWithdraw.then(callback).transact(); } - function withdrawCallback(address sender, IEvmErc20 token) public onlyRole(CALLBACK_ROLE) { + function withdrawCallback(address sender, IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { require( AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, "ERROR: The `Withdraw` XCC is fail" @@ -161,7 +213,11 @@ contract SiloToSilo is AccessControl { } function getTokenAccountId(IEvmErc20 token) public view returns (string memory) { - return registeredTokens[token]; + return registeredTokens[token].nearTokenAccountId; + } + + function isStorageRegistered(IEvmErc20 token) public view returns (bool) { + return registeredTokens[token].isStorageRegistered; } function getUserBalance(IEvmErc20 token, address userAddress) public view returns (uint256) { @@ -174,14 +230,14 @@ contract SiloToSilo is AccessControl { function _stringToUint(bytes memory b) private pure returns (uint256) { uint256 result = 0; - + for (uint256 i = 0; i < b.length; i++) { uint256 v = uint256(uint8(b[i])); if (v >= 48 && v <= 57) { result = result * 10 + (v - 48); } } - + return result; } } diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index 0e34f296..b120caa4 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -138,7 +138,6 @@ mod tests { silo_to_silo_register_token( &self.engine_silo_to_silo_contract, self.engine_mock_token.address.raw(), - self.mock_token.id().to_string(), &user_account.unwrap_or(self.user_account.clone()), &self.engine, check_result, @@ -150,7 +149,6 @@ mod tests { silo_to_silo_register_token( &self.silo_silo_to_silo_contract, self.silo_mock_token.address.raw(), - self.mock_token.id().to_string(), &self.user_account, &self.silo, true, @@ -399,35 +397,6 @@ mod tests { let infra = TestsInfrastructure::init(None).await; //create new user let regular_user_account = infra.worker.dev_create_account().await.unwrap(); - let regular_user_address = - aurora_sdk_integration_tests::aurora_engine_sdk::types::near_account_to_evm_address( - regular_user_account.id().as_bytes(), - ); - - //error on call registerToken by regular user - infra.mint_wnear_engine(Some(regular_user_address)).await; - infra - .approve_spend_wnear_engine(Some(regular_user_account.clone())) - .await; - - infra - .silo_to_silo_register_token_engine(Some(regular_user_account.clone()), true) - .await; - infra.check_token_is_regester_engine(false).await; - - //error on call registerToken by aurora account - let aurora_address = - aurora_sdk_integration_tests::aurora_engine_sdk::types::near_account_to_evm_address( - infra.engine.inner.id().as_bytes(), - ); - infra.mint_wnear_engine(Some(aurora_address)).await; - infra - .approve_spend_wnear_engine(Some(infra.engine.inner.as_account().clone())) - .await; - infra - .silo_to_silo_register_token_engine(Some(infra.engine.inner.as_account().clone()), true) - .await; - infra.check_token_is_regester_engine(false).await; //error on call ftTransferCallCallback by regular user infra @@ -638,7 +607,6 @@ mod tests { async fn silo_to_silo_register_token( silo_to_silo_contract: &DeployedContract, engine_mock_token_address: H160, - near_mock_token_account_id: String, user_account: &Account, engine: &AuroraEngine, check_result: bool, @@ -647,7 +615,23 @@ mod tests { "registerToken", &[ ethabi::Token::Address(engine_mock_token_address), - ethabi::Token::String(near_mock_token_account_id), + ], + ); + + call_aurora_contract( + silo_to_silo_contract.address, + contract_args, + user_account, + engine.inner.id(), + check_result, + ) + .await + .unwrap(); + + let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( + "storageDeposit", + &[ + ethabi::Token::Address(engine_mock_token_address), ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), ], ); From 9a43fc1f4203e5ecd0f1e1175ea9120ec1ac1067 Mon Sep 17 00:00:00 2001 From: karim-en Date: Mon, 14 Aug 2023 13:53:21 +0100 Subject: [PATCH 05/50] Fix integration tests project --- silo-to-silo/integration-tests/Cargo.lock | 2 +- silo-to-silo/integration-tests/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/silo-to-silo/integration-tests/Cargo.lock b/silo-to-silo/integration-tests/Cargo.lock index 3c3f7a54..fefb8120 100644 --- a/silo-to-silo/integration-tests/Cargo.lock +++ b/silo-to-silo/integration-tests/Cargo.lock @@ -261,7 +261,7 @@ dependencies = [ [[package]] name = "aurora-sdk-integration-tests" version = "0.1.0" -source = "git+https://github.com/aurora-is-near/aurora-contracts-sdk.git?branch=silo#21d3d310fdfc185d2867b782f45682bf051f2d36" +source = "git+https://github.com/aurora-is-near/aurora-contracts-sdk.git?rev=fb81299792200d21ffc26fcc43ad5f0794fd928d#fb81299792200d21ffc26fcc43ad5f0794fd928d" dependencies = [ "anyhow", "aurora-engine", diff --git a/silo-to-silo/integration-tests/Cargo.toml b/silo-to-silo/integration-tests/Cargo.toml index 3b0eb3e0..d396ceee 100644 --- a/silo-to-silo/integration-tests/Cargo.toml +++ b/silo-to-silo/integration-tests/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -aurora-sdk-integration-tests = { git = "https://github.com/aurora-is-near/aurora-contracts-sdk.git", branch = "silo" } +aurora-sdk-integration-tests = { git = "https://github.com/aurora-is-near/aurora-contracts-sdk.git", rev = "fb81299792200d21ffc26fcc43ad5f0794fd928d" } serde = {version = "1", features = ["derive"] } serde_json = "1" From 86a8fce85b3b287691e454e276a8723608934217 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 16 Aug 2023 17:08:38 +0100 Subject: [PATCH 06/50] Call without wNEAR transfer & minor code improvments --- silo-to-silo/contracts/src/SiloToSilo.sol | 52 ++++++++++++++++------- silo-to-silo/integration-tests/src/lib.rs | 31 ++++++-------- 2 files changed, 51 insertions(+), 32 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 14053d5e..a298d785 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -24,6 +24,10 @@ contract SiloToSilo is AccessControl { uint64 constant BASE_NEAR_GAS = 10_000_000_000_000; uint64 constant WITHDRAW_NEAR_GAS = 50_000_000_000_000; uint64 constant FT_TRANSFER_CALL_NEAR_GAS = 150_000_000_000_000; + uint128 constant ASCII_0 = 48; + uint128 constant ASCII_9 = 57; + uint128 constant ONE_YOCTO = 1; + uint128 constant NO_DEPOSIT = 0; NEAR public near; string public siloAccountId; @@ -49,14 +53,14 @@ contract SiloToSilo is AccessControl { siloAccountId, "get_nep141_from_erc20", abi.encodePacked(address(token)), - 0, + NO_DEPOSIT, BASE_NEAR_GAS ); PromiseCreateArgs memory callback = near.auroraCall( address(this), abi.encodeWithSelector(this.getNep141FromErc20Callback.selector, token), - 0, + NO_DEPOSIT, BASE_NEAR_GAS ); @@ -78,8 +82,6 @@ contract SiloToSilo is AccessControl { string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; require(bytes(tokenAccountId).length > 0, "The token is not registered!"); - near.wNEAR.transferFrom(msg.sender, address(this), uint256(storageDepositAmount)); - PromiseCreateArgs memory callStorageDeposit = near.call( tokenAccountId, "storage_deposit", @@ -91,7 +93,7 @@ contract SiloToSilo is AccessControl { PromiseCreateArgs memory callback = near.auroraCall( address(this), abi.encodeWithSelector(this.storageDepositCallback.selector, token), - 0, + NO_DEPOSIT, BASE_NEAR_GAS ); callStorageDeposit.then(callback).transact(); @@ -111,7 +113,7 @@ contract SiloToSilo is AccessControl { string calldata receiverId, string calldata message ) external { - require(near.wNEAR.balanceOf(address(this)) > 0, "Not enough wNEAR balance"); + require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); TokenInfo storage tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered, "The token storage is not registered!"); @@ -123,7 +125,8 @@ contract SiloToSilo is AccessControl { // We expect such an error not to happen as long as transactions were executed in one shard. token.withdrawToNear(bytes(getNearAccountId()), amount); - PromiseCreateArgs memory callFtTransfer = near.call( + PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( + near, tokenInfo.nearTokenAccountId, "ft_transfer_call", bytes( @@ -137,14 +140,14 @@ contract SiloToSilo is AccessControl { '"}' ) ), - 1, + ONE_YOCTO, FT_TRANSFER_CALL_NEAR_GAS ); PromiseCreateArgs memory callback = near.auroraCall( address(this), abi.encodeWithSelector(this.ftTransferCallCallback.selector, msg.sender, token, amount), - 0, + NO_DEPOSIT, BASE_NEAR_GAS ); @@ -162,7 +165,7 @@ contract SiloToSilo is AccessControl { } function withdraw(IEvmErc20 token) external { - require(near.wNEAR.balanceOf(address(this)) > 0, "Not enough wNEAR balance"); + require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; require(bytes(tokenAccountId).length > 0, "The token is not registered!"); @@ -170,7 +173,8 @@ contract SiloToSilo is AccessControl { uint256 senderBalance = balance[token][msg.sender]; require(senderBalance > 0, "The signer token balance = 0"); - PromiseCreateArgs memory callWithdraw = near.call( + PromiseCreateArgs memory callWithdraw = _callWithoutTransferWNear( + near, tokenAccountId, "ft_transfer_call", bytes( @@ -184,14 +188,14 @@ contract SiloToSilo is AccessControl { '"}' ) ), - 1, + ONE_YOCTO, WITHDRAW_NEAR_GAS ); PromiseCreateArgs memory callback = near.auroraCall( address(this), abi.encodeWithSelector(this.withdrawCallback.selector, msg.sender, token), - 0, + NO_DEPOSIT, BASE_NEAR_GAS ); @@ -233,11 +237,29 @@ contract SiloToSilo is AccessControl { for (uint256 i = 0; i < b.length; i++) { uint256 v = uint256(uint8(b[i])); - if (v >= 48 && v <= 57) { - result = result * 10 + (v - 48); + if (v >= ASCII_0 && v <= ASCII_9) { + result = result * 10 + (v - ASCII_0); } } return result; } + + /// Creates a base promise. This is not immediately scheduled for execution + /// until transact is called. It can be combined with other promises using + /// `then` combinator. + /// + /// Input is not checekd during promise creation. If it is invalid, the + /// transaction will be scheduled either way, but it will fail during execution. + function _callWithoutTransferWNear( + NEAR storage _near, + string memory targetAccountId, + string memory method, + bytes memory args, + uint128 nearBalance, + uint64 nearGas + ) private view returns (PromiseCreateArgs memory) { + require(_near.initialized, "Near isn't initialized"); + return PromiseCreateArgs(targetAccountId, method, args, nearBalance, nearGas); + } } diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index b120caa4..2e7f0953 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -22,9 +22,12 @@ mod tests { workspaces::{self, AccountId}, }; use std::path::Path; + const ONE_NEAR: u128 = 1_000_000_000_000_000_000_000_000; const ATTACHED_NEAR: u128 = 5_000_000_000_000_000_000_000_000; const NEAR_DEPOSIT: u128 = 2_000_000_000_000_000_000_000_000; + // This deposit is required to subsidise the ONE_YOCTO deposit on call `ft_transfer_call` + const ATTACHED_NEAR_TO_INIT_CONTRACT: u128 = 10 * ONE_NEAR; const TRANSFER_TOKENS_AMOUNT: u64 = 100; const TOKEN_SUPPLY: u64 = 1000000000; @@ -64,23 +67,15 @@ mod tests { user_account.id().as_bytes(), ); - let engine_silo_to_silo_contract = deploy_silo_to_silo_sol_contract( - &engine, - &user_account, - engine_wnear.aurora_token.address, - ) - .await; + let engine_silo_to_silo_contract = + deploy_silo_to_silo_sol_contract(&engine, &user_account, &engine_wnear).await; let mock_token = deploy_mock_token(&worker, user_account.id(), storage_deposit).await; let engine_mock_token = engine.bridge_nep141(mock_token.id()).await.unwrap(); let silo_mock_token = silo.bridge_nep141(mock_token.id()).await.unwrap(); - let silo_silo_to_silo_contract = deploy_silo_to_silo_sol_contract( - &silo, - &user_account, - silo_wnear.aurora_token.address, - ) - .await; + let silo_silo_to_silo_contract = + deploy_silo_to_silo_sol_contract(&silo, &user_account, &silo_wnear).await; TestsInfrastructure { worker: worker, @@ -503,7 +498,7 @@ mod tests { async fn deploy_silo_to_silo_sol_contract( engine: &AuroraEngine, user_account: &workspaces::Account, - wnear_address: Address, + wnear: &Wnear, ) -> DeployedContract { let aurora_sdk_path = Path::new("./aurora-contracts-sdk/aurora-solidity-sdk"); assert!( @@ -542,7 +537,7 @@ mod tests { .unwrap(); let deploy_bytes = constructor.create_deploy_bytes_with_args(&[ - ethabi::Token::Address(wnear_address.raw()), + ethabi::Token::Address(wnear.aurora_token.address.raw()), ethabi::Token::String(engine.inner.id().to_string()), ]); @@ -551,6 +546,10 @@ mod tests { .await .unwrap(); + engine + .mint_wnear(&wnear, address, ATTACHED_NEAR_TO_INIT_CONTRACT) + .await + .unwrap(); constructor.deployed_at(address) } @@ -613,9 +612,7 @@ mod tests { ) { let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( "registerToken", - &[ - ethabi::Token::Address(engine_mock_token_address), - ], + &[ethabi::Token::Address(engine_mock_token_address)], ); call_aurora_contract( From 92a4995bc954eb6685e65b734f099492b552c9da Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 17 Aug 2023 22:07:38 +0100 Subject: [PATCH 07/50] Replace uint256 with u128 --- silo-to-silo/contracts/src/SiloToSilo.sol | 30 ++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index a298d785..de2c06c6 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -33,10 +33,10 @@ contract SiloToSilo is AccessControl { string public siloAccountId; //[auroraErc20Token] => tokenAccountIdOnNear - mapping(IEvmErc20 => TokenInfo) registeredTokens; + mapping(IEvmErc20 => TokenInfo) public registeredTokens; //[auroraErc20Token][userAddressOnAurora] => userBalance - mapping(IEvmErc20 => mapping(address => uint256)) balance; + mapping(IEvmErc20 => mapping(address => uint128)) public balance; event TokenRegistered(IEvmErc20 token, string nearAccountId); @@ -109,7 +109,7 @@ contract SiloToSilo is AccessControl { function ftTransferCallToNear( IEvmErc20 token, - uint256 amount, + uint128 amount, string calldata receiverId, string calldata message ) external { @@ -154,14 +154,16 @@ contract SiloToSilo is AccessControl { callFtTransfer.then(callback).transact(); } - function ftTransferCallCallback(address sender, IEvmErc20 token, uint256 amount) external onlyRole(CALLBACK_ROLE) { - uint256 transferredAmount = 0; - + function ftTransferCallCallback(address sender, IEvmErc20 token, uint128 amount) external onlyRole(CALLBACK_ROLE) { + uint128 transferredAmount = 0; if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); } - balance[token][sender] += (amount - transferredAmount); + uint128 refund_amount = amount - transferredAmount; + if (refund_amount > 0) { + balance[token][sender] += refund_amount; + } } function withdraw(IEvmErc20 token) external { @@ -170,7 +172,7 @@ contract SiloToSilo is AccessControl { string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; require(bytes(tokenAccountId).length > 0, "The token is not registered!"); - uint256 senderBalance = balance[token][msg.sender]; + uint128 senderBalance = balance[token][msg.sender]; require(senderBalance > 0, "The signer token balance = 0"); PromiseCreateArgs memory callWithdraw = _callWithoutTransferWNear( @@ -208,7 +210,7 @@ contract SiloToSilo is AccessControl { "ERROR: The `Withdraw` XCC is fail" ); - uint256 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); + uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); balance[token][sender] -= transferredAmount; } @@ -224,7 +226,7 @@ contract SiloToSilo is AccessControl { return registeredTokens[token].isStorageRegistered; } - function getUserBalance(IEvmErc20 token, address userAddress) public view returns (uint256) { + function getUserBalance(IEvmErc20 token, address userAddress) public view returns (uint128) { return balance[token][userAddress]; } @@ -232,11 +234,11 @@ contract SiloToSilo is AccessControl { return Utils.bytesToHex(abi.encodePacked(auroraAddress)); } - function _stringToUint(bytes memory b) private pure returns (uint256) { - uint256 result = 0; + function _stringToUint(bytes memory b) private pure returns (uint128) { + uint128 result = 0; - for (uint256 i = 0; i < b.length; i++) { - uint256 v = uint256(uint8(b[i])); + for (uint128 i = 0; i < b.length; i++) { + uint128 v = uint128(uint8(b[i])); if (v >= ASCII_0 && v <= ASCII_9) { result = result * 10 + (v - ASCII_0); } From 69796e73746aadc1b9620ca1385997f8def8d5ba Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 17 Aug 2023 23:49:20 +0100 Subject: [PATCH 08/50] Add UUPS proxy --- silo-to-silo/configs/aurora-testnet.json | 6 + silo-to-silo/contracts/src/SiloToSilo.sol | 19 +- silo-to-silo/hardhat.config.js | 64 ++-- silo-to-silo/package.json | 10 +- silo-to-silo/utils/scripts.js | 42 +++ silo-to-silo/yarn.lock | 410 ++++++++++++++++++++-- 6 files changed, 494 insertions(+), 57 deletions(-) create mode 100644 silo-to-silo/configs/aurora-testnet.json create mode 100644 silo-to-silo/utils/scripts.js diff --git a/silo-to-silo/configs/aurora-testnet.json b/silo-to-silo/configs/aurora-testnet.json new file mode 100644 index 00000000..c416cfba --- /dev/null +++ b/silo-to-silo/configs/aurora-testnet.json @@ -0,0 +1,6 @@ +{ + "siloAccountId": "aurora", + "auroraSdkAddress": "0x425cA8f218784ebE2df347E98c626094B63E7f30", + "auroraUtilsAddress": "0xc129336a6995F3b70A7139585403B82098260172", + "wNearAddress": "0x4861825E75ab14553E5aF711EbbE6873d369d146" +} \ No newline at end of file diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index de2c06c6..f0ffb68c 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -6,7 +6,10 @@ import {AuroraSdk, NEAR, PromiseCreateArgs, PromiseResultStatus, PromiseWithCall import "@auroraisnear/aurora-sdk/aurora-sdk/Utils.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/Base64.sol"; -import "@openzeppelin/contracts/access/AccessControl.sol"; +import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "./IEvmErc20.sol"; struct TokenInfo { @@ -14,7 +17,7 @@ struct TokenInfo { bool isStorageRegistered; } -contract SiloToSilo is AccessControl { +contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, PausableUpgradeable { using AuroraSdk for NEAR; using AuroraSdk for PromiseCreateArgs; using AuroraSdk for PromiseWithCallback; @@ -40,7 +43,7 @@ contract SiloToSilo is AccessControl { event TokenRegistered(IEvmErc20 token, string nearAccountId); - constructor(address wnearAddress, string memory _siloAccountId) { + function initialize(address wnearAddress, string memory _siloAccountId) external initializer { near = AuroraSdk.initNear(IERC20_NEAR(wnearAddress)); siloAccountId = _siloAccountId; @@ -264,4 +267,14 @@ contract SiloToSilo is AccessControl { require(_near.initialized, "Near isn't initialized"); return PromiseCreateArgs(targetAccountId, method, args, nearBalance, nearGas); } + + /** + * @dev Internal function called by the proxy contract to authorize an upgrade to a new implementation address + * using the UUPS proxy upgrade pattern. Overrides the default `_authorizeUpgrade` function from the `UUPSUpgradeable` contract. + * This function does not need to perform any extra authorization checks other than restricting the execution of the function to the admin and reverting otherwise. + * @param newImplementation Address of the new implementation contract. + * Requirements: + * - The caller must have the `DEFAULT_ADMIN_ROLE`. + */ + function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE) {} } diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index 1ffd0a5d..89fae791 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -1,30 +1,48 @@ -require('dotenv').config(); +require("dotenv").config(); +require("@nomicfoundation/hardhat-ethers"); +require("@openzeppelin/hardhat-upgrades"); const AURORA_PRIVATE_KEY = process.env.AURORA_PRIVATE_KEY; +task("deploy", "Deploy silo to silo proxy contract") + .addParam("silo", "Config file name without extension") + .setAction(async (taskArgs, hre) => { + const { deploy } = require("./utils/scripts.js"); + const [deployer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await hre.run("compile"); + await deploy( + deployer, + config.wNearAddress, + config.siloAccountId, + config.auroraSdkAddress, + config.auroraUtilsAddress, + ); + }); + module.exports = { - solidity: { - version: "0.8.17", - settings: { - optimizer: { - enabled: true, - runs: 200 - } - } + solidity: { + version: "0.8.21", + settings: { + optimizer: { + enabled: true, + runs: 200, + }, }, - networks: { - testnet_aurora: { - url: 'https://testnet.aurora.dev', - accounts: [`0x${AURORA_PRIVATE_KEY}`], - chainId: 1313161555 - }, - develop_aurora: { - url: 'https://develop.rpc.testnet.aurora.dev:8545', - accounts: [`0x${AURORA_PRIVATE_KEY}`] - }, + }, + networks: { + testnet_aurora: { + url: "https://testnet.aurora.dev", + accounts: [`0x${AURORA_PRIVATE_KEY}`], + chainId: 1313161555, }, - mocha: { - timeout: 100000000 - } + develop_aurora: { + url: "https://develop.rpc.testnet.aurora.dev:8545", + accounts: [`0x${AURORA_PRIVATE_KEY}`], + }, + }, + mocha: { + timeout: 100000000, + }, }; - diff --git a/silo-to-silo/package.json b/silo-to-silo/package.json index 7fd5c05e..f9663c14 100644 --- a/silo-to-silo/package.json +++ b/silo-to-silo/package.json @@ -2,13 +2,17 @@ "name": "hardhat-project", "license": "MIT", "devDependencies": { - "hardhat": "^2.17", + "@nomicfoundation/hardhat-ethers": "^3.0.4", + "ethers": "^6.7.1", + "hardhat": "^2.17.1", "prettier": "^3", "prettier-plugin-solidity": "^1.1.3" }, "dependencies": { "@auroraisnear/aurora-sdk": "^0.0.1", - "@openzeppelin/contracts": "^4.8.1", + "@openzeppelin/contracts": "^4.9.3", + "@openzeppelin/contracts-upgradeable": "^4.9.3", + "@openzeppelin/hardhat-upgrades": "^2.2.0", "dotenv": "^16" } -} \ No newline at end of file +} diff --git a/silo-to-silo/utils/scripts.js b/silo-to-silo/utils/scripts.js new file mode 100644 index 00000000..b35a9125 --- /dev/null +++ b/silo-to-silo/utils/scripts.js @@ -0,0 +1,42 @@ +require("dotenv").config(); +const { ethers, upgrades } = require("hardhat"); + +async function deploy( + deployer, + wnearAuroraAddress, + siloAccountId, + auroraSdkAddress, + auroraUtilsAddress, +) { + console.log("Deploying contracts with the account:", deployer.address); + console.log( + "Account balance:", + (await deployer.provider.getBalance(deployer.address)).toString(), + ); + + const AuroraErc20FastBridge = await ethers.getContractFactory("SiloToSilo", { + libraries: { + AuroraSdk: auroraSdkAddress, + Utils: auroraUtilsAddress, + }, + }); + const fastbridge = AuroraErc20FastBridge.connect(deployer); + let proxy = await upgrades.deployProxy( + fastbridge, + [wnearAuroraAddress, siloAccountId], + { + initializer: "initialize", + unsafeAllowLinkedLibraries: true, + gasLimit: 6000000, + }, + ); + await proxy.waitForDeployment(); + + console.log("SiloToSilo proxy deployed to: ", await proxy.getAddress()); + console.log( + "SiloToSilo impl deployed to: ", + await upgrades.erc1967.getImplementationAddress(await proxy.getAddress()), + ); +} + +exports.deploy = deploy; diff --git a/silo-to-silo/yarn.lock b/silo-to-silo/yarn.lock index 9c94ca0a..a8d0f5f1 100644 --- a/silo-to-silo/yarn.lock +++ b/silo-to-silo/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@adraffy/ens-normalize@1.9.2": + version "1.9.2" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.2.tgz#60111a5d9db45b2e5cbb6231b0bb8d97e8659316" + integrity sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg== + "@auroraisnear/aurora-sdk@^0.0.1": version "0.0.1" resolved "https://registry.yarnpkg.com/@auroraisnear/aurora-sdk/-/aurora-sdk-0.0.1.tgz#5f95deaa11b6d9c921380b1981902aa421ed0cdc" @@ -9,6 +14,39 @@ dependencies: "@openzeppelin/contracts" "^4.8.2" +"@aws-crypto/sha256-js@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@aws-crypto/sha256-js/-/sha256-js-1.2.2.tgz#02acd1a1fda92896fc5a28ec7c6e164644ea32fc" + integrity sha512-Nr1QJIbW/afYYGzYvrF70LtaHrIRtd4TNAglX8BvlfxJLZ45SAmueIKYl5tWoNBPzp65ymXGFK0Bb1vZUpuc9g== + dependencies: + "@aws-crypto/util" "^1.2.2" + "@aws-sdk/types" "^3.1.0" + tslib "^1.11.1" + +"@aws-crypto/util@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@aws-crypto/util/-/util-1.2.2.tgz#b28f7897730eb6538b21c18bd4de22d0ea09003c" + integrity sha512-H8PjG5WJ4wz0UXAFXeJjWCW1vkvIJ3qUUD+rGRwJ2/hj+xT58Qle2MTql/2MGzkU+1JLAFuR6aJpLAjHwhmwwg== + dependencies: + "@aws-sdk/types" "^3.1.0" + "@aws-sdk/util-utf8-browser" "^3.0.0" + tslib "^1.11.1" + +"@aws-sdk/types@^3.1.0": + version "3.391.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.391.0.tgz#d49b0130943f0c60fd9bc99b2a47ec9720e2dd07" + integrity sha512-QpYVFKMOnzHz/JMj/b8wb18qxiT92U/5r5MmtRz2R3LOH6ooTO96k4ozXCrYr0qNed1PAnOj73rPrrH2wnCJKQ== + dependencies: + "@smithy/types" "^2.2.0" + tslib "^2.5.0" + +"@aws-sdk/util-utf8-browser@^3.0.0": + version "3.259.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz#3275a6f5eb334f96ca76635b961d3c50259fd9ff" + integrity sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw== + dependencies: + tslib "^2.3.1" + "@chainsafe/as-sha256@^0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" @@ -45,7 +83,7 @@ "@chainsafe/persistent-merkle-tree" "^0.4.2" case "^1.6.3" -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -398,6 +436,11 @@ tweetnacl "^1.0.3" tweetnacl-util "^0.15.1" +"@noble/hashes@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" + integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== + "@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" @@ -542,6 +585,14 @@ mcl-wasm "^0.7.1" rustbn.js "~0.2.0" +"@nomicfoundation/hardhat-ethers@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.4.tgz#6f0df2424e687e26d6574610de7a36bd69485cc1" + integrity sha512-k9qbLoY7qn6C6Y1LI0gk2kyHXil2Tauj4kGzQ8pgxYXIGw8lWn8tuuL72E11CrlKaXRUvOgF0EXrv/msPI2SbA== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" @@ -608,11 +659,83 @@ "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" -"@openzeppelin/contracts@^4.8.1", "@openzeppelin/contracts@^4.8.2": +"@openzeppelin/contracts-upgradeable@^4.9.3": + version "4.9.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.3.tgz#ff17a80fb945f5102571f8efecb5ce5915cc4811" + integrity sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A== + +"@openzeppelin/contracts@^4.8.2": version "4.9.2" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1" integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg== +"@openzeppelin/contracts@^4.9.3": + version "4.9.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" + integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== + +"@openzeppelin/defender-admin-client@^1.48.0": + version "1.48.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-admin-client/-/defender-admin-client-1.48.0.tgz#acb8d6677a0b1bca463f9017aefaf4b6720123e1" + integrity sha512-MN29JD6jA3PgOxF2tG0aZbMIwOCieYWkK9UbHCq1UzGPrMgGV9NVMUyVdqpv7Ynplwsjp5ZTBDOyttwvTlchHg== + dependencies: + "@openzeppelin/defender-base-client" "1.48.0" + axios "^1.4.0" + ethers "^5.7.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + +"@openzeppelin/defender-base-client@1.48.0", "@openzeppelin/defender-base-client@^1.48.0", "@openzeppelin/defender-base-client@^1.48.0-rc.1": + version "1.48.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-base-client/-/defender-base-client-1.48.0.tgz#9103b1b036db0451b52d7899a277bf24db4c4b06" + integrity sha512-HFO87s010hRrMjyh2xYOCEAkLe21BfIbho7n5/kikA6A1ZgXi7MsEiqnQv1zP4bxMJgxGZ5b3t4tt6fWrakbag== + dependencies: + amazon-cognito-identity-js "^6.0.1" + async-retry "^1.3.3" + axios "^1.4.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + +"@openzeppelin/hardhat-upgrades@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-2.2.0.tgz#b15fe973ff40c9e51943ceac0243512b3256ec89" + integrity sha512-9AqKN52oZyEGPGEzoZIzFJ7UkhxVtw/+ZMVL5CLPYc/8boPkNV2SD4W1rLleiH/XG3qjKNU2vDo5G8fuvidglg== + dependencies: + "@openzeppelin/defender-admin-client" "^1.48.0" + "@openzeppelin/defender-base-client" "^1.48.0" + "@openzeppelin/platform-deploy-client" "^0.10.0" + "@openzeppelin/upgrades-core" "^1.27.0" + chalk "^4.1.0" + debug "^4.1.1" + ethereumjs-util "^7.1.5" + proper-lockfile "^4.1.1" + undici "^5.14.0" + +"@openzeppelin/platform-deploy-client@^0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/platform-deploy-client/-/platform-deploy-client-0.10.0.tgz#017599612ed3b898f94f281b378ac50626365617" + integrity sha512-jayQPeXqw4LnWIrNhNqgikJSre+n2NRrnEu76niSdVXc/faQkG3PmaHtRPJMFgsYxjjAiAfcMYyV95YBDuLexA== + dependencies: + "@ethersproject/abi" "^5.6.3" + "@openzeppelin/defender-base-client" "^1.48.0-rc.1" + axios "^1.4.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + +"@openzeppelin/upgrades-core@^1.27.0": + version "1.28.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.28.0.tgz#19405f272dc09e766c756d9d149cbd680168aef7" + integrity sha512-8RKlyg98Adv+46GxDaR0awL3R8bVCcQ27DcSEwrgWOp6siHh8sZg4a2l+2dhPl1510S6uBfhHSydMH5VX2BV5g== + dependencies: + cbor "^9.0.0" + chalk "^4.1.0" + compare-versions "^6.0.0" + debug "^4.1.1" + ethereumjs-util "^7.0.3" + minimist "^1.2.7" + proper-lockfile "^4.1.1" + solidity-ast "^0.4.26" + "@scure/base@~1.1.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" @@ -703,6 +826,13 @@ "@sentry/types" "5.30.0" tslib "^1.9.3" +"@smithy/types@^2.2.0": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@smithy/types/-/types-2.2.1.tgz#49f2f32bb2f54822c324ecf347b7706016581a0b" + integrity sha512-6nyDOf027ZeJiQVm6PXmLm7dR+hR2YJUkr4VwUniXA8xZUGAu5Mk0zfx2BPFrt+e5YauvlIqQoH0CsrM4tLkfg== + dependencies: + tslib "^2.5.0" + "@solidity-parser/parser@^0.16.0": version "0.16.1" resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.16.1.tgz#f7c8a686974e1536da0105466c4db6727311253c" @@ -734,6 +864,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== +"@types/node@18.15.13": + version "18.15.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== + "@types/pbkdf2@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" @@ -756,13 +891,6 @@ dependencies: "@types/node" "*" -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" @@ -786,6 +914,11 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== +aes-js@4.0.0-beta.5: + version "4.0.0-beta.5" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -801,6 +934,17 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" +amazon-cognito-identity-js@^6.0.1: + version "6.3.3" + resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-6.3.3.tgz#d301309827aa7d74d6e3892cc27f25332c5cba3c" + integrity sha512-pw70WNbyfRPgCr3SsvMlCO/sADUSVytTMwhyTALPG62lmdBeYkvaXMLkQDerN15odSQHG+WFlNmDPCySEfKlNA== + dependencies: + "@aws-crypto/sha256-js" "1.2.2" + buffer "4.9.2" + fast-base64-decode "^1.0.0" + isomorphic-unfetch "^3.0.0" + js-cookie "^2.2.1" + ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -855,6 +999,27 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +async-retry@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== + dependencies: + retry "0.13.1" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axios@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" + integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -867,7 +1032,7 @@ base-x@^3.0.2: dependencies: safe-buffer "^5.0.1" -base64-js@^1.3.1: +base64-js@^1.0.2, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -897,7 +1062,7 @@ bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== @@ -982,6 +1147,15 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== +buffer@4.9.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" + integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + buffer@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -1017,6 +1191,13 @@ catering@^2.1.0, catering@^2.1.1: resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== +cbor@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-9.0.1.tgz#b16e393d4948d44758cd54ac6151379d443b37ae" + integrity sha512-/TQOWyamDxvVIv+DY9cOLNuABkoyz8K/F3QE56539pGVYohx0+MEA1f4lChFTX79dBTBS7R1PF6ovH7G+VtBfQ== + dependencies: + nofilter "^3.1.0" + chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1111,6 +1292,13 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + command-exists@^1.2.8: version "1.2.9" resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" @@ -1121,6 +1309,11 @@ commander@3.0.2: resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== +compare-versions@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a" + integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1171,6 +1364,11 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -1283,7 +1481,18 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: ethjs-util "0.1.6" rlp "^2.2.3" -ethers@^5.7.1: +ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.5: + version "7.1.5" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" + integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + rlp "^2.2.4" + +ethers@^5.7.1, ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -1319,6 +1528,19 @@ ethers@^5.7.1: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" +ethers@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.7.1.tgz#9c65e8b5d8e9ad77b7e8cf1c46099892cfafad49" + integrity sha512-qX5kxIFMfg1i+epfgb0xF4WM7IqapIIu50pOJ17aebkxxa4BacW5jFrQRmCJpDEg2ZK2oNtR5QjrQ1WDBF29dA== + dependencies: + "@adraffy/ens-normalize" "1.9.2" + "@noble/hashes" "1.1.2" + "@noble/secp256k1" "1.7.1" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.5.0" + ethjs-util@0.1.6, ethjs-util@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" @@ -1327,11 +1549,6 @@ ethjs-util@0.1.6, ethjs-util@^0.1.6: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" @@ -1340,6 +1557,11 @@ evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +fast-base64-decode@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418" + integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -1367,11 +1589,20 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -follow-redirects@^1.12.1: +follow-redirects@^1.12.1, follow-redirects@^1.15.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + fp-ts@1.19.3: version "1.19.3" resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" @@ -1453,15 +1684,15 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.4: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -hardhat@^2.17: - version "2.17.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.0.tgz#574478790fa4f4a45c5ccf162e82e54f36671749" - integrity sha512-CaEGa13tkJNe2/rdaBiive4pmdNShwxvdWVhr1zfb6aVpRhQt9VNO0l/UIBt/zzajz38ZFjvhfM2bj8LDXo9gw== +hardhat@^2.17.1: + version "2.17.1" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.17.1.tgz#4b6c8c8f624fd23d9f40185a4af24815d05a486a" + integrity sha512-1PxRkfjhEzXs/wDxI5YgzYBxNmvzifBTjYzuopwel+vXpAhCudplusJthN5eig0FTs4qbi828DBIITEDh8x9LA== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" @@ -1479,7 +1710,6 @@ hardhat@^2.17: "@sentry/node" "^5.18.1" "@types/bn.js" "^5.1.0" "@types/lru-cache" "^5.1.0" - abort-controller "^3.0.0" adm-zip "^0.4.16" aggregate-error "^3.0.0" ansi-escapes "^4.3.0" @@ -1580,7 +1810,7 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.2.1: +ieee754@^1.1.4, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -1664,6 +1894,24 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +isarray@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isomorphic-unfetch@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" + integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== + dependencies: + node-fetch "^2.6.1" + unfetch "^4.2.0" + +js-cookie@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + js-sdsl@^4.1.4: version "4.4.1" resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.1.tgz#9e3c7b566d8d9a7e1fe8fc26d00b5ab0f8918ab3" @@ -1747,7 +1995,12 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash@^4.17.11: +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + +lodash@^4.17.11, lodash@^4.17.19: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -1807,6 +2060,18 @@ memorystream@^0.3.1: resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -1831,6 +2096,11 @@ minimatch@^3.0.4, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimist@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + mnemonist@^0.38.0: version "0.38.5" resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" @@ -1895,11 +2165,23 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== +node-fetch@^2.6.0, node-fetch@^2.6.1: + version "2.6.12" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" + integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== + dependencies: + whatwg-url "^5.0.0" + node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: version "4.6.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== +nofilter@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-3.1.0.tgz#c757ba68801d41ff930ba2ec55bab52ca184aa66" + integrity sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g== + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -2012,6 +2294,20 @@ prettier@^3: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae" integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== +proper-lockfile@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" + integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== + dependencies: + graceful-fs "^4.2.4" + retry "^0.12.0" + signal-exit "^3.0.2" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + queue-microtask@^1.2.2, queue-microtask@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -2067,6 +2363,16 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" +retry@0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== + rimraf@^2.2.8: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -2082,7 +2388,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rlp@^2.2.3: +rlp@^2.2.3, rlp@^2.2.4: version "2.2.7" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== @@ -2172,6 +2478,11 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" @@ -2187,6 +2498,11 @@ solc@0.7.3: semver "^5.5.0" tmp "0.0.33" +solidity-ast@^0.4.26: + version "0.4.49" + resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.49.tgz#ecba89d10c0067845b7848c3a3e8cc61a4fc5b82" + integrity sha512-Pr5sCAj1SFqzwFZw1HPKSq0PehlQNdM8GwKyAVYh2DOn7/cCK8LUKD1HeHnKtTgBW7hi9h4nnnan7hpAg5RhWQ== + solidity-comments-extractor@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" @@ -2297,11 +2613,26 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tslib@^1.9.3: +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +tslib@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + +tslib@^1.11.1, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.3.1, tslib@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" + integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== + tsort@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" @@ -2334,6 +2665,11 @@ undici@^5.14.0: dependencies: busboy "^1.6.0" +unfetch@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" + integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -2354,6 +2690,19 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + workerpool@6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" @@ -2378,6 +2727,11 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + ws@^7.4.6: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" From 301b031705b5081851b8ab99f98408b6f96d802d Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 17 Aug 2023 23:56:05 +0100 Subject: [PATCH 09/50] Fix naming --- silo-to-silo/utils/scripts.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/silo-to-silo/utils/scripts.js b/silo-to-silo/utils/scripts.js index b35a9125..00d50301 100644 --- a/silo-to-silo/utils/scripts.js +++ b/silo-to-silo/utils/scripts.js @@ -14,15 +14,17 @@ async function deploy( (await deployer.provider.getBalance(deployer.address)).toString(), ); - const AuroraErc20FastBridge = await ethers.getContractFactory("SiloToSilo", { - libraries: { - AuroraSdk: auroraSdkAddress, - Utils: auroraUtilsAddress, - }, - }); - const fastbridge = AuroraErc20FastBridge.connect(deployer); + const SiloToSiloContract = ( + await ethers.getContractFactory("SiloToSilo", { + libraries: { + AuroraSdk: auroraSdkAddress, + Utils: auroraUtilsAddress, + }, + }) + ).connect(deployer); + let proxy = await upgrades.deployProxy( - fastbridge, + SiloToSiloContract, [wnearAuroraAddress, siloAccountId], { initializer: "initialize", From 2c64fdc08f4b098be298676cbe5e896208f2ee89 Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 18 Aug 2023 00:19:08 +0100 Subject: [PATCH 10/50] Add upgrade script & minor code improvments --- silo-to-silo/hardhat.config.js | 33 +++++++++++++++----- silo-to-silo/utils/scripts.js | 55 +++++++++++++++++++++++++++++----- 2 files changed, 72 insertions(+), 16 deletions(-) diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index 89fae791..cd53bed6 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -8,17 +8,34 @@ task("deploy", "Deploy silo to silo proxy contract") .addParam("silo", "Config file name without extension") .setAction(async (taskArgs, hre) => { const { deploy } = require("./utils/scripts.js"); - const [deployer] = await hre.ethers.getSigners(); + const [signer] = await hre.ethers.getSigners(); const config = require(`./configs/${taskArgs.silo}.json`); await hre.run("compile"); - await deploy( - deployer, - config.wNearAddress, - config.siloAccountId, - config.auroraSdkAddress, - config.auroraUtilsAddress, - ); + await deploy({ + signer, + wNearAddress: config.wNearAddress, + siloAccountId: config.siloAccountId, + auroraSdkAddress: config.auroraSdkAddress, + auroraUtilsAddress: config.auroraUtilsAddress, + }); + }); + +task("upgrade", "Upgrade silo to silo proxy contract") + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .setAction(async (taskArgs, hre) => { + const { upgrade } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await hre.run("compile"); + await upgrade({ + signer, + proxyAddress: taskArgs.proxy, + auroraSdkAddress: config.auroraSdkAddress, + auroraUtilsAddress: config.auroraUtilsAddress, + }); }); module.exports = { diff --git a/silo-to-silo/utils/scripts.js b/silo-to-silo/utils/scripts.js index 00d50301..45c43a8c 100644 --- a/silo-to-silo/utils/scripts.js +++ b/silo-to-silo/utils/scripts.js @@ -1,17 +1,17 @@ require("dotenv").config(); const { ethers, upgrades } = require("hardhat"); -async function deploy( - deployer, - wnearAuroraAddress, +async function deploy({ + signer, + wNearAddress, siloAccountId, auroraSdkAddress, auroraUtilsAddress, -) { - console.log("Deploying contracts with the account:", deployer.address); +}) { + console.log("Deploying contracts with the account:", signer.address); console.log( "Account balance:", - (await deployer.provider.getBalance(deployer.address)).toString(), + (await signer.provider.getBalance(signer.address)).toString(), ); const SiloToSiloContract = ( @@ -21,11 +21,11 @@ async function deploy( Utils: auroraUtilsAddress, }, }) - ).connect(deployer); + ).connect(signer); let proxy = await upgrades.deployProxy( SiloToSiloContract, - [wnearAuroraAddress, siloAccountId], + [wNearAddress, siloAccountId], { initializer: "initialize", unsafeAllowLinkedLibraries: true, @@ -41,4 +41,43 @@ async function deploy( ); } +async function upgrade({ + signer, + proxyAddress, + auroraSdkAddress, + auroraUtilsAddress, +}) { + console.log("Upgrading contracts with the account:", signer.address); + console.log( + "Account balance:", + (await signer.provider.getBalance(signer.address)).toString(), + ); + + const SiloToSiloContract = ( + await ethers.getContractFactory("SiloToSilo", { + libraries: { + AuroraSdk: auroraSdkAddress, + Utils: auroraUtilsAddress, + }, + }) + ).connect(signer); + + console.log( + "Current implementation address:", + await upgrades.erc1967.getImplementationAddress(proxyAddress), + ); + console.log("Upgrade SiloToSilo contract, proxy address", proxyAddress); + const proxy = await upgrades.upgradeProxy(proxyAddress, SiloToSiloContract, { + unsafeAllowLinkedLibraries: true, + gasLimit: 6000000, + }); + await proxy.waitForDeployment(); + + console.log( + "SiloToSilo impl deployed to: ", + await upgrades.erc1967.getImplementationAddress(await proxy.getAddress()), + ); +} + exports.deploy = deploy; +exports.upgrade = upgrade; From e2eb56ee0016d0ed7175580b9ac03aaf0065f539 Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 18 Aug 2023 00:33:39 +0100 Subject: [PATCH 11/50] Fix tests --- silo-to-silo/integration-tests/src/lib.rs | 27 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index 2e7f0953..595e72a6 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -536,21 +536,36 @@ mod tests { .await .unwrap(); - let deploy_bytes = constructor.create_deploy_bytes_with_args(&[ - ethabi::Token::Address(wnear.aurora_token.address.raw()), - ethabi::Token::String(engine.inner.id().to_string()), - ]); - + let deploy_bytes = constructor.create_deploy_bytes_without_constructor(); let address = engine .deploy_evm_contract_with(user_account, deploy_bytes) .await .unwrap(); + let contract_impl = constructor.deployed_at(address); + let contract_args = contract_impl.create_call_method_bytes_with_args( + "initialize", + &[ + ethabi::Token::Address(wnear.aurora_token.address.raw()), + ethabi::Token::String(engine.inner.id().to_string()), + ], + ); + call_aurora_contract( + contract_impl.address, + contract_args, + &user_account, + engine.inner.id(), + true, + ) + .await + .unwrap(); + engine .mint_wnear(&wnear, address, ATTACHED_NEAR_TO_INIT_CONTRACT) .await .unwrap(); - constructor.deployed_at(address) + + contract_impl } async fn deploy_mock_token( From 866c771d4809922617aa5bd6497577e0881d4332 Mon Sep 17 00:00:00 2001 From: Olga Kunyavskaya Date: Thu, 24 Aug 2023 10:25:05 +0300 Subject: [PATCH 12/50] remove redundant values from libs and allow_paths --- silo-to-silo/contracts/foundry.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/silo-to-silo/contracts/foundry.toml b/silo-to-silo/contracts/foundry.toml index ae0e840f..bac1db2b 100644 --- a/silo-to-silo/contracts/foundry.toml +++ b/silo-to-silo/contracts/foundry.toml @@ -1,8 +1,8 @@ [profile.default] src = 'src' out = 'out' -libs = ['lib', '../node_modules', '../integration-tests/aurora-contracts-sdk/aurora-solidity-sdk/lib'] -allow_paths = ['../node_modules', '../integration-tests/aurora-contracts-sdk/aurora-solidity-sdk/'] +libs = ['../node_modules', '../integration-tests/aurora-contracts-sdk/aurora-solidity-sdk/lib'] +allow_paths = [] solc = "0.8.17" # See more config options https://github.com/foundry-rs/foundry/tree/master/config From 44aeb36f29b898670e4c21d1d6d5b7a2c4b19dd7 Mon Sep 17 00:00:00 2001 From: Karim Date: Wed, 6 Sep 2023 14:43:05 +0100 Subject: [PATCH 13/50] Apply suggestions from code review Co-authored-by: Kirill --- silo-to-silo/contracts/src/SiloToSilo.sol | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index f0ffb68c..3fe5c6e3 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -35,10 +35,10 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, NEAR public near; string public siloAccountId; - //[auroraErc20Token] => tokenAccountIdOnNear + // auroraErc20Token => TokenInfo { nearTokenAccountId, isStorageRegistered } mapping(IEvmErc20 => TokenInfo) public registeredTokens; - //[auroraErc20Token][userAddressOnAurora] => userBalance + // auroraErc20Token => (userAddressOnAurora => userBalance) mapping(IEvmErc20 => mapping(address => uint128)) public balance; event TokenRegistered(IEvmErc20 token, string nearAccountId); @@ -73,7 +73,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, function getNep141FromErc20Callback(IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { require( AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, - "ERROR: The `get_nep141_from_erc20` XCC is fail" + "ERROR: The `get_nep141_from_erc20()` XCC call failed" ); string memory nearTokenAccountId = string(AuroraSdk.promiseResult(0).output); @@ -105,7 +105,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, function storageDepositCallback(IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { require( AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, - "ERROR: The `storage_deposit` XCC is fail" + "ERROR: The `storage_deposit()` XCC call failed" ); registeredTokens[token].isStorageRegistered = true; } @@ -119,13 +119,13 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); TokenInfo storage tokenInfo = registeredTokens[token]; - require(tokenInfo.isStorageRegistered, "The token storage is not registered!"); + require(tokenInfo.isStorageRegistered, "The token storage is not registered"); token.transferFrom(msg.sender, address(this), amount); - // WARNING: The `withdrawToNear` method works asynchronously. - // As a result, there is no guarantee that this method will be completed before `initTransfer`. - // In case of such an error, the user will be able to call `withdraw` method and get his/her tokens back. - // We expect such an error not to happen as long as transactions were executed in one shard. + // WARNING: The `withdrawToNear()` method works asynchronously. + // As a result, there is no guarantee that this method will be completed before `initTransfer()`. + // In case of such an error, the user will be able to call the `withdraw()` method and get his tokens back. + // We expect such an error not to happen as long as transactions are executed in one shard. token.withdrawToNear(bytes(getNearAccountId()), amount); PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( @@ -173,7 +173,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; - require(bytes(tokenAccountId).length > 0, "The token is not registered!"); + require(bytes(tokenAccountId).length > 0, "The token is not registered"); uint128 senderBalance = balance[token][msg.sender]; require(senderBalance > 0, "The signer token balance = 0"); @@ -210,14 +210,14 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, function withdrawCallback(address sender, IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { require( AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, - "ERROR: The `Withdraw` XCC is fail" + "ERROR: The `withdrawFromNear()` XCC call failed" ); uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); balance[token][sender] -= transferredAmount; } - function getNearAccountId() public view returns (string memory) { + function getImplicitNearAccountIdForSelf() public view returns (string memory) { return string.concat(_addressToString(address(this)), ".", siloAccountId); } From 699e8a8c24d7ce7dec6cf046e7507bb617d02c5d Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 6 Sep 2023 14:59:49 +0100 Subject: [PATCH 14/50] Check if the storage already registered --- silo-to-silo/contracts/src/SiloToSilo.sol | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 3fe5c6e3..349bd664 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -82,13 +82,16 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external { + require(registeredTokens[token].isStorageRegistered == false, "The token's storage is already registered"); string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; - require(bytes(tokenAccountId).length > 0, "The token is not registered!"); + require(bytes(tokenAccountId).length > 0, "The token is not registered"); PromiseCreateArgs memory callStorageDeposit = near.call( tokenAccountId, "storage_deposit", - bytes(string.concat('{"account_id": "', getNearAccountId(), '", "registration_only": true }')), + bytes( + string.concat('{"account_id": "', getImplicitNearAccountIdForSelf(), '", "registration_only": true }') + ), storageDepositAmount, BASE_NEAR_GAS ); @@ -126,7 +129,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, // As a result, there is no guarantee that this method will be completed before `initTransfer()`. // In case of such an error, the user will be able to call the `withdraw()` method and get his tokens back. // We expect such an error not to happen as long as transactions are executed in one shard. - token.withdrawToNear(bytes(getNearAccountId()), amount); + token.withdrawToNear(bytes(getImplicitNearAccountIdForSelf()), amount); PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( near, From 1ce0d4d0892c0a896c55e81bd0b68011f954fedb Mon Sep 17 00:00:00 2001 From: karim-en Date: Sun, 10 Sep 2023 22:34:47 +0100 Subject: [PATCH 15/50] Minor code improvment --- silo-to-silo/contracts/src/SiloToSilo.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 349bd664..8465e1b2 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -82,12 +82,12 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external { - require(registeredTokens[token].isStorageRegistered == false, "The token's storage is already registered"); - string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; - require(bytes(tokenAccountId).length > 0, "The token is not registered"); + TokenInfo storage token_info = registeredTokens[token]; + require(token_info.isStorageRegistered == false, "The token's storage is already registered"); + require(bytes(token_info.nearTokenAccountId).length > 0, "The token is not registered"); PromiseCreateArgs memory callStorageDeposit = near.call( - tokenAccountId, + token_info.nearTokenAccountId, "storage_deposit", bytes( string.concat('{"account_id": "', getImplicitNearAccountIdForSelf(), '", "registration_only": true }') From f87f955887f5a7c12435ec5f1810f72e93a746ff Mon Sep 17 00:00:00 2001 From: karim-en Date: Sun, 10 Sep 2023 23:36:42 +0100 Subject: [PATCH 16/50] Fix test --- silo-to-silo/integration-tests/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index 595e72a6..d5f6bd99 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -697,7 +697,7 @@ mod tests { engine: &AuroraEngine, ) { let contract_args = - silo_to_silo_contract.create_call_method_bytes_with_args("getNearAccountId", &[]); + silo_to_silo_contract.create_call_method_bytes_with_args("getImplicitNearAccountIdForSelf", &[]); let outcome = call_aurora_contract( silo_to_silo_contract.address, From 1e58cff5c4c2d5f8d1da86e855bdf0840162968f Mon Sep 17 00:00:00 2001 From: karim-en Date: Sun, 10 Sep 2023 23:54:41 +0100 Subject: [PATCH 17/50] Use `ONE_NEAR` --- silo-to-silo/integration-tests/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index d5f6bd99..5fac0859 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -24,15 +24,15 @@ mod tests { use std::path::Path; const ONE_NEAR: u128 = 1_000_000_000_000_000_000_000_000; - const ATTACHED_NEAR: u128 = 5_000_000_000_000_000_000_000_000; - const NEAR_DEPOSIT: u128 = 2_000_000_000_000_000_000_000_000; + const ATTACHED_NEAR: u128 = 5 * ONE_NEAR; + const NEAR_DEPOSIT: u128 = 2 * ONE_NEAR; // This deposit is required to subsidise the ONE_YOCTO deposit on call `ft_transfer_call` const ATTACHED_NEAR_TO_INIT_CONTRACT: u128 = 10 * ONE_NEAR; const TRANSFER_TOKENS_AMOUNT: u64 = 100; const TOKEN_SUPPLY: u64 = 1000000000; - const NEP141_STORAGE_DEPOSIT: u128 = 12_500_000_000_000_000_000_000; + const NEP141_STORAGE_DEPOSIT: u128 = (0.0125 * ONE_NEAR as f64) as u128; struct TestsInfrastructure { worker: Worker, From 68f3109afe594c083b4fe86948262f3f247a3168 Mon Sep 17 00:00:00 2001 From: karim-en Date: Mon, 11 Sep 2023 22:16:27 +0100 Subject: [PATCH 18/50] Fix variable naming --- silo-to-silo/contracts/src/SiloToSilo.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 8465e1b2..92e3b393 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -82,12 +82,12 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external { - TokenInfo storage token_info = registeredTokens[token]; - require(token_info.isStorageRegistered == false, "The token's storage is already registered"); - require(bytes(token_info.nearTokenAccountId).length > 0, "The token is not registered"); + TokenInfo storage tokenInfo = registeredTokens[token]; + require(tokenInfo.isStorageRegistered == false, "The token's storage is already registered"); + require(bytes(tokenInfo.nearTokenAccountId).length > 0, "The token is not registered"); PromiseCreateArgs memory callStorageDeposit = near.call( - token_info.nearTokenAccountId, + tokenInfo.nearTokenAccountId, "storage_deposit", bytes( string.concat('{"account_id": "', getImplicitNearAccountIdForSelf(), '", "registration_only": true }') From 4bc4e99df8d15953e19d304bdc0b0dce9965b934 Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 15 Sep 2023 23:50:42 +0100 Subject: [PATCH 19/50] Add more events & minor improvments --- silo-to-silo/contracts/src/SiloToSilo.sol | 39 ++++++++++++++++++++--- silo-to-silo/integration-tests/src/lib.rs | 2 ++ 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 92e3b393..5ffc2cd6 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -42,6 +42,15 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, mapping(IEvmErc20 => mapping(address => uint128)) public balance; event TokenRegistered(IEvmErc20 token, string nearAccountId); + event TokenStorageRegistered(IEvmErc20 token, string nearAccountId); + event Withdraw(IEvmErc20 token, address recipient, uint128 transferedAmount); + event FtTransferCall( + IEvmErc20 indexed token, + string indexed receiverId, + uint128 amount, + uint128 transferedAmount, + string message + ); function initialize(address wnearAddress, string memory _siloAccountId) external initializer { near = AuroraSdk.initNear(IERC20_NEAR(wnearAddress)); @@ -52,6 +61,8 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function registerToken(IEvmErc20 token) external { + require(bytes(registeredTokens[token].nearTokenAccountId).length == 0, "The token is already registered"); + PromiseCreateArgs memory callGetNep141FromErc20 = near.call( siloAccountId, "get_nep141_from_erc20", @@ -77,12 +88,12 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, ); string memory nearTokenAccountId = string(AuroraSdk.promiseResult(0).output); - registeredTokens[token] = TokenInfo(nearTokenAccountId, false); + registeredTokens[token].nearTokenAccountId = nearTokenAccountId; emit TokenRegistered(token, nearTokenAccountId); } function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external { - TokenInfo storage tokenInfo = registeredTokens[token]; + TokenInfo memory tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered == false, "The token's storage is already registered"); require(bytes(tokenInfo.nearTokenAccountId).length > 0, "The token is not registered"); @@ -110,7 +121,9 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, "ERROR: The `storage_deposit()` XCC call failed" ); - registeredTokens[token].isStorageRegistered = true; + TokenInfo storage tokenInfo = registeredTokens[token]; + tokenInfo.isStorageRegistered = true; + emit TokenStorageRegistered(token, tokenInfo.nearTokenAccountId); } function ftTransferCallToNear( @@ -152,7 +165,14 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, PromiseCreateArgs memory callback = near.auroraCall( address(this), - abi.encodeWithSelector(this.ftTransferCallCallback.selector, msg.sender, token, amount), + abi.encodeWithSelector( + this.ftTransferCallCallback.selector, + msg.sender, + token, + amount, + receiverId, + message + ), NO_DEPOSIT, BASE_NEAR_GAS ); @@ -160,7 +180,13 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, callFtTransfer.then(callback).transact(); } - function ftTransferCallCallback(address sender, IEvmErc20 token, uint128 amount) external onlyRole(CALLBACK_ROLE) { + function ftTransferCallCallback( + address sender, + IEvmErc20 token, + uint128 amount, + string calldata receiverId, + string calldata message + ) external onlyRole(CALLBACK_ROLE) { uint128 transferredAmount = 0; if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); @@ -170,6 +196,8 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, if (refund_amount > 0) { balance[token][sender] += refund_amount; } + + emit FtTransferCall(token, receiverId, amount, transferredAmount, message); } function withdraw(IEvmErc20 token) external { @@ -218,6 +246,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); balance[token][sender] -= transferredAmount; + emit Withdraw(token, sender, transferredAmount); } function getImplicitNearAccountIdForSelf() public view returns (string memory) { diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index 5fac0859..e63aca10 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -266,6 +266,8 @@ mod tests { ethabi::Token::Address(self.user_address.raw()), ethabi::Token::Address(self.engine_mock_token.address.raw()), ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), + ethabi::Token::String("receiverId".into()), + ethabi::Token::String("message".into()) ], ); From 3dedaab014c1ae068833f6e3de81fdda8923a3e3 Mon Sep 17 00:00:00 2001 From: karim-en Date: Sat, 16 Sep 2023 00:08:11 +0100 Subject: [PATCH 20/50] Withdraw: decrease the balance in main call --- silo-to-silo/contracts/src/SiloToSilo.sol | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 5ffc2cd6..60777d3a 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -203,11 +203,12 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, function withdraw(IEvmErc20 token) external { require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); - string storage tokenAccountId = registeredTokens[token].nearTokenAccountId; + string memory tokenAccountId = registeredTokens[token].nearTokenAccountId; require(bytes(tokenAccountId).length > 0, "The token is not registered"); uint128 senderBalance = balance[token][msg.sender]; require(senderBalance > 0, "The signer token balance = 0"); + balance[token][msg.sender] -= senderBalance; PromiseCreateArgs memory callWithdraw = _callWithoutTransferWNear( near, @@ -230,7 +231,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, PromiseCreateArgs memory callback = near.auroraCall( address(this), - abi.encodeWithSelector(this.withdrawCallback.selector, msg.sender, token), + abi.encodeWithSelector(this.withdrawCallback.selector, msg.sender, token, senderBalance), NO_DEPOSIT, BASE_NEAR_GAS ); @@ -238,14 +239,19 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, callWithdraw.then(callback).transact(); } - function withdrawCallback(address sender, IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { + function withdrawCallback(address sender, IEvmErc20 token, uint128 amount) external onlyRole(CALLBACK_ROLE) { require( AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, "ERROR: The `withdrawFromNear()` XCC call failed" ); uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); - balance[token][sender] -= transferredAmount; + uint128 refundAmount = amount - transferredAmount; + + if (refundAmount > 0) { + balance[token][sender] += refundAmount; + } + emit Withdraw(token, sender, transferredAmount); } From 5c91b1cb7301d7bd63d3306a986262e0852da4b5 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 20 Sep 2023 21:08:44 +0100 Subject: [PATCH 21/50] Improve `withdrawCallback` --- silo-to-silo/contracts/src/SiloToSilo.sol | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 60777d3a..f0b252f8 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -134,7 +134,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, ) external { require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); - TokenInfo storage tokenInfo = registeredTokens[token]; + TokenInfo memory tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered, "The token storage is not registered"); token.transferFrom(msg.sender, address(this), amount); @@ -192,9 +192,9 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); } - uint128 refund_amount = amount - transferredAmount; - if (refund_amount > 0) { - balance[token][sender] += refund_amount; + uint128 refundAmount = amount - transferredAmount; + if (refundAmount > 0) { + balance[token][sender] += refundAmount; } emit FtTransferCall(token, receiverId, amount, transferredAmount, message); @@ -240,14 +240,12 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function withdrawCallback(address sender, IEvmErc20 token, uint128 amount) external onlyRole(CALLBACK_ROLE) { - require( - AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, - "ERROR: The `withdrawFromNear()` XCC call failed" - ); + uint128 transferredAmount = 0; + if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { + transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); + } - uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); uint128 refundAmount = amount - transferredAmount; - if (refundAmount > 0) { balance[token][sender] += refundAmount; } From da5713c4a87981aff85742956b8657135edfe716 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 20 Sep 2023 21:38:49 +0100 Subject: [PATCH 22/50] Remove comment --- silo-to-silo/contracts/src/SiloToSilo.sol | 4 ---- 1 file changed, 4 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index f0b252f8..9b6455ce 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -138,10 +138,6 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, require(tokenInfo.isStorageRegistered, "The token storage is not registered"); token.transferFrom(msg.sender, address(this), amount); - // WARNING: The `withdrawToNear()` method works asynchronously. - // As a result, there is no guarantee that this method will be completed before `initTransfer()`. - // In case of such an error, the user will be able to call the `withdraw()` method and get his tokens back. - // We expect such an error not to happen as long as transactions are executed in one shard. token.withdrawToNear(bytes(getImplicitNearAccountIdForSelf()), amount); PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( From 7548ad3a4440089cc5318f91562146a7036b38e7 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 20 Sep 2023 22:22:34 +0100 Subject: [PATCH 23/50] Add `withdrawTo` function --- silo-to-silo/contracts/src/SiloToSilo.sol | 69 ++++++++--------------- 1 file changed, 22 insertions(+), 47 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 9b6455ce..bb09a886 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -133,16 +133,24 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, string calldata message ) external { require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); - TokenInfo memory tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered, "The token storage is not registered"); token.transferFrom(msg.sender, address(this), amount); token.withdrawToNear(bytes(getImplicitNearAccountIdForSelf()), amount); + _ftTransferCallToNear(token, tokenInfo.nearTokenAccountId, amount, receiverId, message); + } + function _ftTransferCallToNear( + IEvmErc20 token, + string memory nearTokenAccountId, + uint128 amount, + string memory receiverId, + string memory message + ) private { PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( near, - tokenInfo.nearTokenAccountId, + nearTokenAccountId, "ft_transfer_call", bytes( string.concat( @@ -196,57 +204,24 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, emit FtTransferCall(token, receiverId, amount, transferredAmount, message); } + function withdrawTo(IEvmErc20 token, string calldata receiverId, string calldata message) external { + _withdraw(token, receiverId, message); + } + function withdraw(IEvmErc20 token) external { - require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); + _withdraw(token, siloAccountId, _addressToString(msg.sender)); + } - string memory tokenAccountId = registeredTokens[token].nearTokenAccountId; - require(bytes(tokenAccountId).length > 0, "The token is not registered"); + function _withdraw(IEvmErc20 token, string memory receiverId, string memory message) private { + require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); + TokenInfo memory tokenInfo = registeredTokens[token]; + require(tokenInfo.isStorageRegistered, "The token storage is not registered"); uint128 senderBalance = balance[token][msg.sender]; - require(senderBalance > 0, "The signer token balance = 0"); + require(senderBalance > 0, "The signer balance = 0"); balance[token][msg.sender] -= senderBalance; - PromiseCreateArgs memory callWithdraw = _callWithoutTransferWNear( - near, - tokenAccountId, - "ft_transfer_call", - bytes( - string.concat( - '{"receiver_id": "', - siloAccountId, - '", "amount": "', - Strings.toString(senderBalance), - '", "msg": "', - _addressToString(msg.sender), - '"}' - ) - ), - ONE_YOCTO, - WITHDRAW_NEAR_GAS - ); - - PromiseCreateArgs memory callback = near.auroraCall( - address(this), - abi.encodeWithSelector(this.withdrawCallback.selector, msg.sender, token, senderBalance), - NO_DEPOSIT, - BASE_NEAR_GAS - ); - - callWithdraw.then(callback).transact(); - } - - function withdrawCallback(address sender, IEvmErc20 token, uint128 amount) external onlyRole(CALLBACK_ROLE) { - uint128 transferredAmount = 0; - if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { - transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); - } - - uint128 refundAmount = amount - transferredAmount; - if (refundAmount > 0) { - balance[token][sender] += refundAmount; - } - - emit Withdraw(token, sender, transferredAmount); + _ftTransferCallToNear(token, tokenInfo.nearTokenAccountId, senderBalance, receiverId, message); } function getImplicitNearAccountIdForSelf() public view returns (string memory) { From 312d8e7970736ceea3e449364c06eacb67193f20 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 20 Sep 2023 22:45:48 +0100 Subject: [PATCH 24/50] Add pause/unpause logic --- silo-to-silo/contracts/src/SiloToSilo.sol | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index bb09a886..009eaff5 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -23,6 +23,8 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, using AuroraSdk for PromiseWithCallback; bytes32 public constant CALLBACK_ROLE = keccak256("CALLBACK_ROLE"); + bytes32 public constant PAUSE_ADMIN_ROLE = keccak256("PAUSE_ADMIN_ROLE"); + bytes32 public constant UNPAUSE_ADMIN_ROLE = keccak256("UNPAUSE_ADMIN_ROLE"); uint64 constant BASE_NEAR_GAS = 10_000_000_000_000; uint64 constant WITHDRAW_NEAR_GAS = 50_000_000_000_000; @@ -58,9 +60,11 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, _grantRole(CALLBACK_ROLE, AuroraSdk.nearRepresentitiveImplicitAddress(address(this))); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(PAUSE_ADMIN_ROLE, msg.sender); + _grantRole(UNPAUSE_ADMIN_ROLE, msg.sender); } - function registerToken(IEvmErc20 token) external { + function registerToken(IEvmErc20 token) external whenNotPaused { require(bytes(registeredTokens[token].nearTokenAccountId).length == 0, "The token is already registered"); PromiseCreateArgs memory callGetNep141FromErc20 = near.call( @@ -92,7 +96,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, emit TokenRegistered(token, nearTokenAccountId); } - function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external { + function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external whenNotPaused { TokenInfo memory tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered == false, "The token's storage is already registered"); require(bytes(tokenInfo.nearTokenAccountId).length > 0, "The token is not registered"); @@ -131,7 +135,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 amount, string calldata receiverId, string calldata message - ) external { + ) external whenNotPaused { require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); TokenInfo memory tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered, "The token storage is not registered"); @@ -204,11 +208,11 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, emit FtTransferCall(token, receiverId, amount, transferredAmount, message); } - function withdrawTo(IEvmErc20 token, string calldata receiverId, string calldata message) external { + function withdrawTo(IEvmErc20 token, string calldata receiverId, string calldata message) external whenNotPaused { _withdraw(token, receiverId, message); } - function withdraw(IEvmErc20 token) external { + function withdraw(IEvmErc20 token) external whenNotPaused { _withdraw(token, siloAccountId, _addressToString(msg.sender)); } @@ -240,6 +244,14 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, return balance[token][userAddress]; } + function pause() external onlyRole(PAUSE_ADMIN_ROLE) { + _pause(); + } + + function unpause() external onlyRole(UNPAUSE_ADMIN_ROLE) { + _unpause(); + } + function _addressToString(address auroraAddress) private pure returns (string memory) { return Utils.bytesToHex(abi.encodePacked(auroraAddress)); } From 95a1b89fb6a874be0599e0de40b92473206b7d45 Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 21 Sep 2023 00:57:57 +0100 Subject: [PATCH 25/50] Emit event on initiating a ft transfer call --- silo-to-silo/contracts/src/SiloToSilo.sol | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 009eaff5..c990afcf 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -36,6 +36,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, NEAR public near; string public siloAccountId; + uint256 public ftTransferCallCounter; // auroraErc20Token => TokenInfo { nearTokenAccountId, isStorageRegistered } mapping(IEvmErc20 => TokenInfo) public registeredTokens; @@ -46,7 +47,15 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, event TokenRegistered(IEvmErc20 token, string nearAccountId); event TokenStorageRegistered(IEvmErc20 token, string nearAccountId); event Withdraw(IEvmErc20 token, address recipient, uint128 transferedAmount); + event InitFtTransferCall( + uint256 indexed nonce, + IEvmErc20 indexed token, + string indexed receiverId, + uint128 amount, + string message + ); event FtTransferCall( + uint256 indexed nonce, IEvmErc20 indexed token, string indexed receiverId, uint128 amount, @@ -152,6 +161,9 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, string memory receiverId, string memory message ) private { + ftTransferCallCounter += 1; + emit InitFtTransferCall(ftTransferCallCounter, token, receiverId, amount, message); + PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( near, nearTokenAccountId, @@ -175,6 +187,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, address(this), abi.encodeWithSelector( this.ftTransferCallCallback.selector, + ftTransferCallCounter, msg.sender, token, amount, @@ -189,6 +202,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function ftTransferCallCallback( + uint256 nonce, address sender, IEvmErc20 token, uint128 amount, @@ -205,7 +219,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, balance[token][sender] += refundAmount; } - emit FtTransferCall(token, receiverId, amount, transferredAmount, message); + emit FtTransferCall(nonce, token, receiverId, amount, transferredAmount, message); } function withdrawTo(IEvmErc20 token, string calldata receiverId, string calldata message) external whenNotPaused { From c752ebbef870b1f956eb874ee1fe8c5e9c2818b2 Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 21 Sep 2023 01:05:42 +0100 Subject: [PATCH 26/50] Remove apostrophe to fix git formating --- silo-to-silo/contracts/src/SiloToSilo.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index c990afcf..918f5567 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -107,7 +107,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external whenNotPaused { TokenInfo memory tokenInfo = registeredTokens[token]; - require(tokenInfo.isStorageRegistered == false, "The token's storage is already registered"); + require(tokenInfo.isStorageRegistered == false, "The storage is already registered"); require(bytes(tokenInfo.nearTokenAccountId).length > 0, "The token is not registered"); PromiseCreateArgs memory callStorageDeposit = near.call( From f3fa4c2f8f85cea02ee5a134637a50bd621e781a Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 21 Sep 2023 01:06:53 +0100 Subject: [PATCH 27/50] Remove apostrophe to fix git formating --- silo-to-silo/contracts/src/SiloToSilo.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 918f5567..46df2c63 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -297,7 +297,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 nearBalance, uint64 nearGas ) private view returns (PromiseCreateArgs memory) { - require(_near.initialized, "Near isn't initialized"); + require(_near.initialized, "Near is not initialized"); return PromiseCreateArgs(targetAccountId, method, args, nearBalance, nearGas); } From 9b64b592a69f5f188a5cb3f796fe5f5050dead25 Mon Sep 17 00:00:00 2001 From: karim-en Date: Mon, 25 Sep 2023 16:13:47 +0100 Subject: [PATCH 28/50] Add possibility to register recipients --- silo-to-silo/contracts/src/SiloToSilo.sol | 66 ++++++++++++++++++----- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 46df2c63..35c54cc0 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -44,8 +44,12 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, // auroraErc20Token => (userAddressOnAurora => userBalance) mapping(IEvmErc20 => mapping(address => uint128)) public balance; + // auroraErc20Token => (nearAccountId => isStorageRegistered) + mapping(IEvmErc20 => mapping(string => bool)) public registeredRecipients; + event TokenRegistered(IEvmErc20 token, string nearAccountId); event TokenStorageRegistered(IEvmErc20 token, string nearAccountId); + event RecipientStorageRegistered(IEvmErc20 token, string recipientId); event Withdraw(IEvmErc20 token, address recipient, uint128 transferedAmount); event InitFtTransferCall( uint256 indexed nonce, @@ -106,37 +110,63 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function storageDeposit(IEvmErc20 token, uint128 storageDepositAmount) external whenNotPaused { - TokenInfo memory tokenInfo = registeredTokens[token]; - require(tokenInfo.isStorageRegistered == false, "The storage is already registered"); - require(bytes(tokenInfo.nearTokenAccountId).length > 0, "The token is not registered"); + require(registeredTokens[token].isStorageRegistered == false, "The storage is already registered"); + _storageDeposit(token, storageDepositAmount, getImplicitNearAccountIdForSelf(), false); + } + + function recipientStorageDeposit( + IEvmErc20 token, + uint128 storageDepositAmount, + string memory recipientId + ) external whenNotPaused { + require(registeredRecipients[token][recipientId] == false, "The storage is already registered"); + _storageDeposit(token, storageDepositAmount, recipientId, true); + } + + function _storageDeposit( + IEvmErc20 token, + uint128 storageDepositAmount, + string memory recipientId, + bool isRecipientStorageDeposit + ) private { + string memory nearTokenAccountId = registeredTokens[token].nearTokenAccountId; + require(bytes(nearTokenAccountId).length > 0, "The token is not registered"); PromiseCreateArgs memory callStorageDeposit = near.call( - tokenInfo.nearTokenAccountId, + nearTokenAccountId, "storage_deposit", - bytes( - string.concat('{"account_id": "', getImplicitNearAccountIdForSelf(), '", "registration_only": true }') - ), + bytes(string.concat('{"account_id": "', recipientId, '", "registration_only": true }')), storageDepositAmount, BASE_NEAR_GAS ); PromiseCreateArgs memory callback = near.auroraCall( address(this), - abi.encodeWithSelector(this.storageDepositCallback.selector, token), + abi.encodeWithSelector(this.storageDepositCallback.selector, token, recipientId, isRecipientStorageDeposit), NO_DEPOSIT, BASE_NEAR_GAS ); callStorageDeposit.then(callback).transact(); } - function storageDepositCallback(IEvmErc20 token) external onlyRole(CALLBACK_ROLE) { + function storageDepositCallback( + IEvmErc20 token, + string memory recipientId, + bool isRecipientStorageDeposit + ) external onlyRole(CALLBACK_ROLE) { require( AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, "ERROR: The `storage_deposit()` XCC call failed" ); - TokenInfo storage tokenInfo = registeredTokens[token]; - tokenInfo.isStorageRegistered = true; - emit TokenStorageRegistered(token, tokenInfo.nearTokenAccountId); + + if (isRecipientStorageDeposit) { + registeredRecipients[token][recipientId] = true; + emit RecipientStorageRegistered(token, recipientId); + } else { + TokenInfo storage tokenInfo = registeredTokens[token]; + tokenInfo.isStorageRegistered = true; + emit TokenStorageRegistered(token, tokenInfo.nearTokenAccountId); + } } function ftTransferCallToNear( @@ -144,7 +174,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 amount, string calldata receiverId, string calldata message - ) external whenNotPaused { + ) public whenNotPaused { require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); TokenInfo memory tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered, "The token storage is not registered"); @@ -154,6 +184,16 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, _ftTransferCallToNear(token, tokenInfo.nearTokenAccountId, amount, receiverId, message); } + function safeFtTransferCallToNear( + IEvmErc20 token, + uint128 amount, + string calldata receiverId, + string calldata message + ) external whenNotPaused { + require(registeredRecipients[token][receiverId], "The storage is not registered for the recipient"); + ftTransferCallToNear(token, amount, receiverId, message); + } + function _ftTransferCallToNear( IEvmErc20 token, string memory nearTokenAccountId, From b5ceaba5eefe4214c78a346f0c4d1bb555d2d966 Mon Sep 17 00:00:00 2001 From: karim-en Date: Mon, 25 Sep 2023 16:19:35 +0100 Subject: [PATCH 29/50] Fix test --- silo-to-silo/integration-tests/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index e63aca10..18657995 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -258,11 +258,13 @@ mod tests { } pub async fn call_ft_transfer_call_callback_engine(&self, user_account: Account) { + let nonce = 0; let contract_args = self .engine_silo_to_silo_contract .create_call_method_bytes_with_args( "ftTransferCallCallback", &[ + ethabi::Token::Uint(U256::from(nonce)), ethabi::Token::Address(self.user_address.raw()), ethabi::Token::Address(self.engine_mock_token.address.raw()), ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), From 8cece50c2a9bc18b68724ef25c7221359affe0c4 Mon Sep 17 00:00:00 2001 From: karim-en Date: Mon, 25 Sep 2023 16:51:08 +0100 Subject: [PATCH 30/50] Add `sender` to the transfers events --- silo-to-silo/contracts/src/SiloToSilo.sol | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 35c54cc0..bb34d849 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -51,15 +51,10 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, event TokenStorageRegistered(IEvmErc20 token, string nearAccountId); event RecipientStorageRegistered(IEvmErc20 token, string recipientId); event Withdraw(IEvmErc20 token, address recipient, uint128 transferedAmount); - event InitFtTransferCall( - uint256 indexed nonce, - IEvmErc20 indexed token, - string indexed receiverId, - uint128 amount, - string message - ); + event InitFtTransferCall(uint256 nonce, address indexed sender, IEvmErc20 indexed token, string indexed receiverId); event FtTransferCall( - uint256 indexed nonce, + uint256 nonce, + address indexed sender, IEvmErc20 indexed token, string indexed receiverId, uint128 amount, @@ -202,7 +197,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, string memory message ) private { ftTransferCallCounter += 1; - emit InitFtTransferCall(ftTransferCallCounter, token, receiverId, amount, message); + emit InitFtTransferCall(ftTransferCallCounter, msg.sender, token, receiverId); PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( near, @@ -259,7 +254,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, balance[token][sender] += refundAmount; } - emit FtTransferCall(nonce, token, receiverId, amount, transferredAmount, message); + emit FtTransferCall(nonce, sender, token, receiverId, amount, transferredAmount, message); } function withdrawTo(IEvmErc20 token, string calldata receiverId, string calldata message) external whenNotPaused { From 5263f9ebbe94e2b7af9b572f8115535439dcd3d6 Mon Sep 17 00:00:00 2001 From: karim-en Date: Tue, 26 Sep 2023 18:00:17 +0100 Subject: [PATCH 31/50] Add `isRecipientStorageRegistered` --- silo-to-silo/contracts/src/SiloToSilo.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index bb34d849..98ba8568 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -289,6 +289,10 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, return registeredTokens[token].isStorageRegistered; } + function isRecipientStorageRegistered(IEvmErc20 token, string calldata recipient) public view returns (bool) { + return registeredRecipients[token][recipient]; + } + function getUserBalance(IEvmErc20 token, address userAddress) public view returns (uint128) { return balance[token][userAddress]; } From 82c51e23b2387c7329b8f81c57bd6a695c49caa0 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 27 Sep 2023 13:06:05 +0100 Subject: [PATCH 32/50] Index `nonce` instead of `receiverId` --- silo-to-silo/contracts/src/SiloToSilo.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 98ba8568..f2762448 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -51,12 +51,12 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, event TokenStorageRegistered(IEvmErc20 token, string nearAccountId); event RecipientStorageRegistered(IEvmErc20 token, string recipientId); event Withdraw(IEvmErc20 token, address recipient, uint128 transferedAmount); - event InitFtTransferCall(uint256 nonce, address indexed sender, IEvmErc20 indexed token, string indexed receiverId); + event InitFtTransferCall(uint256 indexed nonce, address indexed sender, IEvmErc20 indexed token, string receiverId); event FtTransferCall( - uint256 nonce, + uint256 indexed nonce, address indexed sender, IEvmErc20 indexed token, - string indexed receiverId, + string receiverId, uint128 amount, uint128 transferedAmount, string message From 1f44131bf5182cc7e187dbceeb14c1d787c3c8b8 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 27 Sep 2023 13:14:55 +0100 Subject: [PATCH 33/50] Add amount to the event --- silo-to-silo/contracts/src/SiloToSilo.sol | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index f2762448..2d990f59 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -51,7 +51,13 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, event TokenStorageRegistered(IEvmErc20 token, string nearAccountId); event RecipientStorageRegistered(IEvmErc20 token, string recipientId); event Withdraw(IEvmErc20 token, address recipient, uint128 transferedAmount); - event InitFtTransferCall(uint256 indexed nonce, address indexed sender, IEvmErc20 indexed token, string receiverId); + event InitFtTransferCall( + uint256 indexed nonce, + address indexed sender, + IEvmErc20 indexed token, + string receiverId, + uint128 amount + ); event FtTransferCall( uint256 indexed nonce, address indexed sender, @@ -197,7 +203,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, string memory message ) private { ftTransferCallCounter += 1; - emit InitFtTransferCall(ftTransferCallCounter, msg.sender, token, receiverId); + emit InitFtTransferCall(ftTransferCallCounter, msg.sender, token, receiverId, amount); PromiseCreateArgs memory callFtTransfer = _callWithoutTransferWNear( near, From f73b5035cec45edf1193f3e41e3e28e01fe3f91f Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 27 Sep 2023 14:13:20 +0100 Subject: [PATCH 34/50] Add support for native tokens --- silo-to-silo/contracts/src/SiloToSilo.sol | 47 ++++++++++++++++++++--- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 2d990f59..26559339 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -68,9 +68,14 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, string message ); - function initialize(address wnearAddress, string memory _siloAccountId) external initializer { + function initialize( + address wnearAddress, + string memory _siloAccountId, + string memory _nativeTokenAccountId + ) external initializer { near = AuroraSdk.initNear(IERC20_NEAR(wnearAddress)); siloAccountId = _siloAccountId; + registeredTokens[IEvmErc20(address(0))].nearTokenAccountId = _nativeTokenAccountId; _grantRole(CALLBACK_ROLE, AuroraSdk.nearRepresentitiveImplicitAddress(address(this))); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); @@ -175,13 +180,19 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 amount, string calldata receiverId, string calldata message - ) public whenNotPaused { + ) public payable whenNotPaused { require(near.wNEAR.balanceOf(address(this)) >= ONE_YOCTO, "Not enough wNEAR balance"); TokenInfo memory tokenInfo = registeredTokens[token]; require(tokenInfo.isStorageRegistered, "The token storage is not registered"); - token.transferFrom(msg.sender, address(this), amount); - token.withdrawToNear(bytes(getImplicitNearAccountIdForSelf()), amount); + if (address(token) == address(0)) { + require(msg.value == amount, "Incorrect attached value"); + _withdrawNativeTokenToNear(bytes(getImplicitNearAccountIdForSelf()), msg.value); + } else { + token.transferFrom(msg.sender, address(this), amount); + token.withdrawToNear(bytes(getImplicitNearAccountIdForSelf()), amount); + } + _ftTransferCallToNear(token, tokenInfo.nearTokenAccountId, amount, receiverId, message); } @@ -190,7 +201,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 amount, string calldata receiverId, string calldata message - ) external whenNotPaused { + ) external payable whenNotPaused { require(registeredRecipients[token][receiverId], "The storage is not registered for the recipient"); ftTransferCallToNear(token, amount, receiverId, message); } @@ -268,7 +279,15 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, } function withdraw(IEvmErc20 token) external whenNotPaused { - _withdraw(token, siloAccountId, _addressToString(msg.sender)); + string memory messageStr = _addressToString(msg.sender); + if (address(token) == address(0)) { + messageStr = string.concat( + "fake.near:0000000000000000000000000000000000000000000000000000000000000000", + messageStr + ); + } + + _withdraw(token, siloAccountId, messageStr); } function _withdraw(IEvmErc20 token, string memory receiverId, string memory message) private { @@ -328,6 +347,22 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, return result; } + function _withdrawNativeTokenToNear(bytes memory recipient, uint256 amount) private { + bytes memory input = abi.encodePacked("\x00", recipient); + uint input_size = 1 + recipient.length; + assembly { + let res := call( + gas(), + 0xe9217bc70b7ed1f598ddd3199e80b093fa71124f, + amount, + add(input, 32), + input_size, + 0, + 32 + ) + } + } + /// Creates a base promise. This is not immediately scheduled for execution /// until transact is called. It can be combined with other promises using /// `then` combinator. From 9f6e14889c47fc9cba2a7d959e6513466a9a732a Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 27 Sep 2023 14:21:28 +0100 Subject: [PATCH 35/50] Update deploy script --- silo-to-silo/configs/aurora-testnet.json | 1 + silo-to-silo/hardhat.config.js | 1 + silo-to-silo/utils/scripts.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/silo-to-silo/configs/aurora-testnet.json b/silo-to-silo/configs/aurora-testnet.json index c416cfba..8b40246c 100644 --- a/silo-to-silo/configs/aurora-testnet.json +++ b/silo-to-silo/configs/aurora-testnet.json @@ -1,5 +1,6 @@ { "siloAccountId": "aurora", + "nativeTokenAccountId": "aurora", "auroraSdkAddress": "0x425cA8f218784ebE2df347E98c626094B63E7f30", "auroraUtilsAddress": "0xc129336a6995F3b70A7139585403B82098260172", "wNearAddress": "0x4861825E75ab14553E5aF711EbbE6873d369d146" diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index cd53bed6..e41d9a9b 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -16,6 +16,7 @@ task("deploy", "Deploy silo to silo proxy contract") signer, wNearAddress: config.wNearAddress, siloAccountId: config.siloAccountId, + nativeTokenAccountId: config.siloAccountId, auroraSdkAddress: config.auroraSdkAddress, auroraUtilsAddress: config.auroraUtilsAddress, }); diff --git a/silo-to-silo/utils/scripts.js b/silo-to-silo/utils/scripts.js index 45c43a8c..d74804ae 100644 --- a/silo-to-silo/utils/scripts.js +++ b/silo-to-silo/utils/scripts.js @@ -5,6 +5,7 @@ async function deploy({ signer, wNearAddress, siloAccountId, + nativeTokenAccountId, auroraSdkAddress, auroraUtilsAddress, }) { @@ -25,7 +26,7 @@ async function deploy({ let proxy = await upgrades.deployProxy( SiloToSiloContract, - [wNearAddress, siloAccountId], + [wNearAddress, siloAccountId, nativeTokenAccountId], { initializer: "initialize", unsafeAllowLinkedLibraries: true, From 7803719a971cfc29279f0330884383e34be04098 Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 12 Oct 2023 18:41:19 +0100 Subject: [PATCH 36/50] Update toolchain --- silo-to-silo/integration-tests/mock_token/rust-toolchain | 2 +- silo-to-silo/integration-tests/rust-toolchain | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/silo-to-silo/integration-tests/mock_token/rust-toolchain b/silo-to-silo/integration-tests/mock_token/rust-toolchain index 2f3cf789..5299106e 100644 --- a/silo-to-silo/integration-tests/mock_token/rust-toolchain +++ b/silo-to-silo/integration-tests/mock_token/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "1.66.1" +channel = "1.70.0" components = ["clippy", "rustfmt"] diff --git a/silo-to-silo/integration-tests/rust-toolchain b/silo-to-silo/integration-tests/rust-toolchain index 2f3cf789..5299106e 100644 --- a/silo-to-silo/integration-tests/rust-toolchain +++ b/silo-to-silo/integration-tests/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "1.66.1" +channel = "1.70.0" components = ["clippy", "rustfmt"] From d4d939d2dbc2c00fba2ced5a1ac656877c47a321 Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 12 Oct 2023 18:46:30 +0100 Subject: [PATCH 37/50] Add extra check for attached value --- silo-to-silo/contracts/src/SiloToSilo.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 26559339..849615dd 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -189,6 +189,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, require(msg.value == amount, "Incorrect attached value"); _withdrawNativeTokenToNear(bytes(getImplicitNearAccountIdForSelf()), msg.value); } else { + require(msg.value == 0, "Incorrect attached value"); token.transferFrom(msg.sender, address(this), amount); token.withdrawToNear(bytes(getImplicitNearAccountIdForSelf()), amount); } From c4b54bd32e0e281939a3418da6b76ca2635268f6 Mon Sep 17 00:00:00 2001 From: Olga Kunyavskaya Date: Thu, 12 Oct 2023 21:05:03 +0300 Subject: [PATCH 38/50] Silo-to-silo: extra tests (#229) * storage deposit outside contract test * long msg test * remove unused import * fix tests * fix tests * test transfer eth * test send eth back * eth withdraw test --- silo-to-silo/contracts/src/SiloToSilo.sol | 11 +- silo-to-silo/integration-tests/Cargo.toml | 2 +- silo-to-silo/integration-tests/src/lib.rs | 410 +++++++++++++++++++++- 3 files changed, 402 insertions(+), 21 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 849615dd..f1c90676 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -64,8 +64,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, IEvmErc20 indexed token, string receiverId, uint128 amount, - uint128 transferedAmount, - string message + uint128 transferedAmount ); function initialize( @@ -244,8 +243,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, msg.sender, token, amount, - receiverId, - message + receiverId ), NO_DEPOSIT, BASE_NEAR_GAS @@ -259,8 +257,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, address sender, IEvmErc20 token, uint128 amount, - string calldata receiverId, - string calldata message + string calldata receiverId ) external onlyRole(CALLBACK_ROLE) { uint128 transferredAmount = 0; if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { @@ -272,7 +269,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, balance[token][sender] += refundAmount; } - emit FtTransferCall(nonce, sender, token, receiverId, amount, transferredAmount, message); + emit FtTransferCall(nonce, sender, token, receiverId, amount, transferredAmount); } function withdrawTo(IEvmErc20 token, string calldata receiverId, string calldata message) external whenNotPaused { diff --git a/silo-to-silo/integration-tests/Cargo.toml b/silo-to-silo/integration-tests/Cargo.toml index d396ceee..035751c7 100644 --- a/silo-to-silo/integration-tests/Cargo.toml +++ b/silo-to-silo/integration-tests/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" [dependencies] aurora-sdk-integration-tests = { git = "https://github.com/aurora-is-near/aurora-contracts-sdk.git", rev = "fb81299792200d21ffc26fcc43ad5f0794fd928d" } serde = {version = "1", features = ["derive"] } -serde_json = "1" +serde_json = "1" \ No newline at end of file diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index 18657995..db74aa18 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -1,9 +1,7 @@ #[cfg(test)] mod tests { use aurora_sdk_integration_tests::aurora_engine::erc20::ERC20; - use aurora_sdk_integration_tests::aurora_engine_types::parameters::engine::{ - SubmitResult, TransactionStatus, - }; + use aurora_sdk_integration_tests::aurora_engine_types::parameters::engine::{FunctionCallArgsV2, SubmitResult, TransactionStatus}; use aurora_sdk_integration_tests::aurora_engine_types::H160; use aurora_sdk_integration_tests::wnear::Wnear; use aurora_sdk_integration_tests::workspaces::network::Sandbox; @@ -22,6 +20,8 @@ mod tests { workspaces::{self, AccountId}, }; use std::path::Path; + use aurora_sdk_integration_tests::aurora_engine_types::types::WeiU256; + const ONE_NEAR: u128 = 1_000_000_000_000_000_000_000_000; const ATTACHED_NEAR: u128 = 5 * ONE_NEAR; @@ -115,6 +115,13 @@ mod tests { .unwrap(); } + pub async fn mint_eth_engine(&self, user_address: Option
, amount: u64) { + self.engine + .mint_account(user_address.unwrap_or(self.user_address.clone()), 0, Wei::new_u64(amount)) + .await + .unwrap(); + } + pub async fn approve_spend_wnear_engine(&self, user_account: Option) { approve_spend_tokens( &self.engine_wnear.aurora_token, @@ -245,7 +252,7 @@ mod tests { .await; } - pub async fn check_user_balance_engine(&self, expected_value: u8) { + pub async fn check_user_balance_engine(&self, expected_value: u64) { check_get_user_balance( &self.engine_silo_to_silo_contract, &self.user_account, @@ -269,7 +276,6 @@ mod tests { ethabi::Token::Address(self.engine_mock_token.address.raw()), ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), ethabi::Token::String("receiverId".into()), - ethabi::Token::String("message".into()) ], ); @@ -278,6 +284,7 @@ mod tests { contract_args, &user_account, self.engine.inner.id(), + 0, true, ) .await @@ -379,7 +386,7 @@ mod tests { infra.check_user_balance_engine(100).await; withdraw( &infra.engine_silo_to_silo_contract, - &infra.engine_mock_token, + infra.engine_mock_token.address.raw(), infra.engine.inner.id(), infra.user_account.clone(), ) @@ -440,6 +447,370 @@ mod tests { assert_eq!(balance_engine_before, balance_engine_after); } + #[tokio::test] + async fn storage_deposit_outside_contract_test() { + let infra = TestsInfrastructure::init(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + + infra.mint_wnear_engine(None).await; + infra.approve_spend_wnear_engine(None).await; + + let implicit_account = infra.engine_silo_to_silo_contract.address.encode() + "." + infra.engine.inner.id(); + + storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; + storage_deposit(&infra.mock_token, infra.silo.inner.id(), None).await; + storage_deposit(&infra.mock_token, &implicit_account, None).await; + + infra.silo_to_silo_register_token_engine(None, true).await; + + engine_mint_tokens(infra.user_address, &infra.engine_mock_token, &infra.engine).await; + infra.approve_spend_mock_tokens_engine().await; + + let balance_engine_before = infra.get_mock_token_balance_engine().await; + infra.engine_to_silo_transfer(true).await; + + let balance_engine_after = infra.get_mock_token_balance_engine().await; + assert_eq!( + (balance_engine_before - balance_engine_after).as_u64(), + TRANSFER_TOKENS_AMOUNT + ); + + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), TRANSFER_TOKENS_AMOUNT); + } + + #[tokio::test] + async fn long_msg_test() { + let infra = TestsInfrastructure::init(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + infra.mint_wnear_engine(None).await; + infra.approve_spend_wnear_engine(None).await; + storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; + storage_deposit(&infra.mock_token, infra.silo.inner.id(), None).await; + infra.silo_to_silo_register_token_engine(None, true).await; + + let mut msg_len = 1; + let mut step = 1; + + for i in 0..17 { + let mut msg = String::with_capacity(msg_len); + for _ in 0..msg_len { + msg.push('?'); + } + + println!("{}", msg_len); + + engine_mint_tokens(infra.user_address, &infra.engine_mock_token, &infra.engine).await; + + let balance_engine_before = infra.get_mock_token_balance_engine().await; + assert_eq!(balance_engine_before.as_u64(), TRANSFER_TOKENS_AMOUNT); + + infra.approve_spend_mock_tokens_engine().await; + + let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address(infra.engine_mock_token.address.raw()), + ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(msg), + ], + ); + + let _ = call_aurora_contract( + infra.engine_silo_to_silo_contract.address, + contract_args, + &infra.user_account, + infra.engine.inner.id(), + 0, + false, + ).await; + + let balance_engine_after = infra.get_mock_token_balance_engine().await; + if balance_engine_after.as_u64() == 0 { + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), 0); + infra.check_user_balance_engine((i + 1) * TRANSFER_TOKENS_AMOUNT).await; + step = step * 2; + msg_len += step; + } else { + assert_eq!(balance_engine_after.as_u64(), TRANSFER_TOKENS_AMOUNT); + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), 0); + infra.check_user_balance_engine(i * TRANSFER_TOKENS_AMOUNT).await; + break; + } + } + } + + #[tokio::test] + async fn transfer_eth_test() { + let infra = TestsInfrastructure::init(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + infra.mint_wnear_engine(None).await; + infra.mint_wnear_engine(Some(infra.engine_silo_to_silo_contract.address)).await; + infra.approve_spend_wnear_engine(None).await; + + infra.mint_eth_engine(None, 200).await; + let silo_eth_token = infra.silo.bridge_nep141(infra.engine.inner.id()).await.unwrap(); + + storage_deposit(&infra.engine.inner, infra.engine.inner.id(), None).await; + storage_deposit(&infra.engine.inner, infra.silo.inner.id(), None).await; + + let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( + "storageDeposit", + &[ + ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), + ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), + ], + ); + + call_aurora_contract( + infra.engine_silo_to_silo_contract.address, + contract_args, + &infra.user_account, + infra.engine.inner.id(), + 0, + true, + ) + .await + .unwrap(); + + let user_balance_before = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(user_balance_before, 200); + + let user_balance_before_silo = infra.silo + .erc20_balance_of(&silo_eth_token, infra.user_address) + .await + .unwrap(); + + assert_eq!(user_balance_before_silo.as_u64(), 0); + + let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), + ethabi::Token::Uint(U256::from(200)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(infra.user_address.encode()), + ], + ); + + call_aurora_contract( + infra.engine_silo_to_silo_contract.address, + contract_args, + &infra.user_account, + infra.engine.inner.id(), + 200, + true, + ).await.unwrap(); + + let user_balance_after = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(user_balance_after, 0); + + let user_balance_after_silo = infra.silo + .erc20_balance_of(&silo_eth_token, infra.user_address) + .await + .unwrap(); + + assert_eq!(user_balance_after_silo.as_u64(), 200); + + // Transfer from silo back to aurora + infra.mint_wnear_silo().await; + infra.approve_spend_wnear_silo().await; + + silo_to_silo_register_token( + &infra.silo_silo_to_silo_contract, + silo_eth_token.address.raw(), + &infra.user_account, + &infra.silo, + true, + ).await; + + approve_spend_tokens( + &silo_eth_token, + infra.silo_silo_to_silo_contract.address, + &infra.user_account, + &infra.silo, + ).await; + + infra.silo_to_engine_transfer().await; + + let contract_args = infra.silo_silo_to_silo_contract.create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address(silo_eth_token.address.raw()), + ethabi::Token::Uint(U256::from(200)), + ethabi::Token::String(infra.engine.inner.id().to_string()), + ethabi::Token::String("fake.near:0000000000000000000000000000000000000000000000000000000000000000".to_string() + &infra.user_address.encode()), + ], + ); + + call_aurora_contract( + infra.silo_silo_to_silo_contract.address, + contract_args, + &infra.user_account, + infra.silo.inner.id(), + 0, + true, + ).await.unwrap(); + + let user_balance_after_back_transfer = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(user_balance_after_back_transfer, 200); + + let user_balance_after_back_transfer_silo = infra.silo + .erc20_balance_of(&silo_eth_token, infra.user_address) + .await + .unwrap(); + + assert_eq!(user_balance_after_back_transfer_silo.as_u64(), 0); + } + + #[tokio::test] + async fn eth_withdraw_test() { + let infra = TestsInfrastructure::init(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + infra.mint_wnear_engine(None).await; + infra.mint_wnear_engine(Some(infra.engine_silo_to_silo_contract.address)).await; + infra.approve_spend_wnear_engine(None).await; + + infra.mint_eth_engine(None, 200).await; + + let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( + "storageDeposit", + &[ + ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), + ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), + ], + ); + + call_aurora_contract( + infra.engine_silo_to_silo_contract.address, + contract_args, + &infra.user_account, + infra.engine.inner.id(), + 0, + true, + ) + .await + .unwrap(); + + let user_balance_before = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(user_balance_before, 200); + + let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), + ethabi::Token::Uint(U256::from(200)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(infra.user_address.encode()), + ], + ); + + call_aurora_contract( + infra.engine_silo_to_silo_contract.address, + contract_args, + &infra.user_account, + infra.engine.inner.id(), + 200, + true, + ).await.unwrap(); + + let user_balance_after = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(user_balance_after, 0); + + check_get_user_balance( + &infra.engine_silo_to_silo_contract, + &infra.user_account, + "0x0000000000000000000000000000000000000000".parse().unwrap(), + infra.user_address.raw(), + &infra.engine, + 200, + ).await; + + withdraw( + &infra.engine_silo_to_silo_contract, + "0x0000000000000000000000000000000000000000".parse().unwrap(), + infra.engine.inner.id(), + infra.user_account.clone(), + ).await; + + let balance_engine_after_withdraw = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(balance_engine_after_withdraw, 200); + + check_get_user_balance( + &infra.engine_silo_to_silo_contract, + &infra.user_account, + "0x0000000000000000000000000000000000000000".parse().unwrap(), + infra.user_address.raw(), + &infra.engine, + 0, + ).await; + } + + #[tokio::test] + async fn test_ft_transfer_to_silo_with_incorrect_deposit() { + let infra = TestsInfrastructure::init(None).await; + + mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; + + infra.mint_wnear_engine(None).await; + infra.approve_spend_wnear_engine(None).await; + + infra.silo_to_silo_register_token_engine(None, true).await; + infra.check_token_is_regester_engine(true).await; + check_near_account_id( + &infra.engine_silo_to_silo_contract, + &infra.user_account, + &infra.engine, + ) + .await; + + storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; + storage_deposit(&infra.mock_token, infra.silo.inner.id(), None).await; + + engine_mint_tokens(infra.user_address, &infra.engine_mock_token, &infra.engine).await; + infra.approve_spend_mock_tokens_engine().await; + infra.mint_eth_engine(None, TRANSFER_TOKENS_AMOUNT).await; + + let balance_engine_before = infra.get_mock_token_balance_engine().await; + + let mut user_eth_balance = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(user_eth_balance, TRANSFER_TOKENS_AMOUNT); + + let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address(infra.engine_mock_token.address.raw()), + ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(infra.user_address.encode()), + ], + ); + + call_aurora_contract( + infra.engine_silo_to_silo_contract.address, + contract_args, + &infra.user_account, + infra.engine.inner.id(), + TRANSFER_TOKENS_AMOUNT as u128, + true, + ).await.unwrap(); + + user_eth_balance = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + assert_eq!(user_eth_balance, TRANSFER_TOKENS_AMOUNT); + + let balance_engine_after = infra.get_mock_token_balance_engine().await; + assert_eq!(balance_engine_before, balance_engine_after); + let balance_silo = infra.get_mock_token_balance_silo().await; + assert_eq!(balance_silo.as_u64(), 0); + } + #[ignore] #[tokio::test] async fn error_on_withdraw_to_near() { @@ -474,7 +845,7 @@ mod tests { assert_eq!(balance_silo.as_u64(), 0); infra - .check_user_balance_engine(TRANSFER_TOKENS_AMOUNT as u8) + .check_user_balance_engine(TRANSFER_TOKENS_AMOUNT) .await; storage_deposit( @@ -487,7 +858,7 @@ mod tests { .await; withdraw( &infra.engine_silo_to_silo_contract, - &infra.engine_mock_token, + infra.engine_mock_token.address.raw(), infra.engine.inner.id(), infra.user_account.clone(), ) @@ -552,6 +923,7 @@ mod tests { &[ ethabi::Token::Address(wnear.aurora_token.address.raw()), ethabi::Token::String(engine.inner.id().to_string()), + ethabi::Token::String(engine.inner.id().to_string()) ], ); call_aurora_contract( @@ -559,6 +931,7 @@ mod tests { contract_args, &user_account, engine.inner.id(), + 0, true, ) .await @@ -639,6 +1012,7 @@ mod tests { contract_args, user_account, engine.inner.id(), + 0, check_result, ) .await @@ -657,6 +1031,7 @@ mod tests { contract_args, user_account, engine.inner.id(), + 0, check_result, ) .await @@ -681,6 +1056,7 @@ mod tests { contract_args, user_account, engine.inner.id(), + 0, true, ) .await; @@ -708,6 +1084,7 @@ mod tests { contract_args, user_account, engine.inner.id(), + 0, true, ) .await; @@ -725,7 +1102,7 @@ mod tests { engine_mock_token_address: H160, user_address: H160, engine: &AuroraEngine, - expected_value: u8, + expected_value: u64, ) { let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( "getUserBalance", @@ -739,13 +1116,16 @@ mod tests { contract_args, user_account, engine.inner.id(), + 0, true, ) .await; let result = outcome.unwrap().borsh::().unwrap(); if let TransactionStatus::Succeed(res) = result.status { - assert_eq!(res[res.len() - 1], expected_value); + let mut buf = [0u8; 8]; + buf.copy_from_slice(&res.as_slice()[res.len() - 8..res.len()]); + assert_eq!(u64::from_be_bytes(buf), expected_value); } } @@ -824,6 +1204,7 @@ mod tests { contract_args, &user_account, silo1_address, + 0, check_output, ) .await @@ -832,13 +1213,13 @@ mod tests { async fn withdraw( silo_to_silo_contract: &DeployedContract, - token_account: &ERC20, + token_address: H160, engine_address: &AccountId, user_account: Account, ) { let contract_args = silo_to_silo_contract.create_call_method_bytes_with_args( "withdraw", - &[ethabi::Token::Address(token_account.address.raw())], + &[ethabi::Token::Address(token_address)], ); call_aurora_contract( @@ -846,6 +1227,7 @@ mod tests { contract_args, &user_account, engine_address, + 0, true, ) .await @@ -857,10 +1239,12 @@ mod tests { contract_args: Vec, user_account: &Account, engine_account: &AccountId, + deposit: u128, check_output: bool, ) -> ExecutionFinalResult { - let call_args = CallArgs::V1(FunctionCallArgsV1 { + let call_args = CallArgs::V2(FunctionCallArgsV2 { contract: contract_address, + value: WeiU256::from(U256::from(deposit)), input: contract_args, }); From 7c9a9464d57d767572fb526094d53960aa2cb03d Mon Sep 17 00:00:00 2001 From: Olga Kunyavskaya Date: Thu, 12 Oct 2023 21:07:09 +0300 Subject: [PATCH 39/50] Silo-to-silo: scripts for interaction with SiloToSilo contract (#230) * scripts for interactions * ft_transfer_call * Delete silo-to-silo/.openzeppelin/unknown-1313161554.json --------- Co-authored-by: Karim --- silo-to-silo/Makefile | 49 ++++++ silo-to-silo/configs/aurora-mainnet.json | 8 + .../configs/enpower-silo-testnet.json | 6 + silo-to-silo/hardhat.config.js | 150 ++++++++++++++++- silo-to-silo/utils/scripts.js | 154 ++++++++++++++++-- 5 files changed, 354 insertions(+), 13 deletions(-) create mode 100644 silo-to-silo/Makefile create mode 100644 silo-to-silo/configs/aurora-mainnet.json create mode 100644 silo-to-silo/configs/enpower-silo-testnet.json diff --git a/silo-to-silo/Makefile b/silo-to-silo/Makefile new file mode 100644 index 00000000..c245484d --- /dev/null +++ b/silo-to-silo/Makefile @@ -0,0 +1,49 @@ +SILO_TO_SILO_ADDRESS=0xE0302bE5963B1f13003AB3a4798d2853BAE731a7 + +NETWORK=mainnet_aurora +CONFIG_NAME="aurora-mainnet" + +AURORA_TOKEN_ADDRESS="0xB12BFcA5A55806AaF64E99521918A4bf0fC40802" + +RECEIVER_ID="silo-1.aurora-silo-dev.near" +AMOUNT="100000" +MSG="" + +deploy: + yarn hardhat deploy --silo $(CONFIG_NAME) --network $(NETWORK) + +upgrade: + yarn hardhat upgrade --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --network $(NETWORK) + +register_token: + yarn hardhat register_token --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + +get_token_near_account_id: + yarn hardhat get_token_near_account_id --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + +storage_deposit: + yarn hardhat storage_deposit --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + +is_storage_registered: + yarn hardhat is_storage_registered --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + +safe_ft_transfer_call_to_near: + yarn hardhat safe_ft_transfer_call_to_near --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --amount $(AMOUNT) --msg $(MSG) --network $(NETWORK) + +ft_transfer_call_to_near: + yarn hardhat ft_transfer_call_to_near --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --amount $(AMOUNT) --msg $(MSG) --network $(NETWORK) + +recipient_storage_deposit: + yarn hardhat recipient_storage_deposit --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --network $(NETWORK) + +is_recipient_storage_registered: + yarn hardhat is_recipient_storage_registered --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --network $(NETWORK) + +get_user_balance: + yarn hardhat get_user_balance --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + +withdraw: + yarn hardhat withdraw --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + +deploySDK: + yarn hardhat deploy-sdk --network $(NETWORK) diff --git a/silo-to-silo/configs/aurora-mainnet.json b/silo-to-silo/configs/aurora-mainnet.json new file mode 100644 index 00000000..217848f3 --- /dev/null +++ b/silo-to-silo/configs/aurora-mainnet.json @@ -0,0 +1,8 @@ +{ + "siloAccountId": "aurora", + "nativeTokenAccountId": "aurora", + "auroraSdkAddress": "0xc9279246BC677a528a9A28b48Ea67EA898E526a4", + "auroraUtilsAddress": "0xF59eFA6A6065674D639d8b5f1FDdADf7F8E5E8E2", + "auroraCodecAddress": "0xC042D3F70ADc2f74a1717147f9DDF413fee487C1", + "wNearAddress": "0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d" +} \ No newline at end of file diff --git a/silo-to-silo/configs/enpower-silo-testnet.json b/silo-to-silo/configs/enpower-silo-testnet.json new file mode 100644 index 00000000..2a1ba022 --- /dev/null +++ b/silo-to-silo/configs/enpower-silo-testnet.json @@ -0,0 +1,6 @@ +{ + "siloAccountId": "silo-1.aurora-silo-dev.near", + "auroraSdkAddress": "", + "auroraUtilsAddress": "", + "wNearAddress": "" +} \ No newline at end of file diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index e41d9a9b..f01d7e36 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -16,7 +16,7 @@ task("deploy", "Deploy silo to silo proxy contract") signer, wNearAddress: config.wNearAddress, siloAccountId: config.siloAccountId, - nativeTokenAccountId: config.siloAccountId, + nativeTokenAccountId: config.nativeTokenAccountId, auroraSdkAddress: config.auroraSdkAddress, auroraUtilsAddress: config.auroraUtilsAddress, }); @@ -39,6 +39,145 @@ task("upgrade", "Upgrade silo to silo proxy contract") }); }); +task('register_token', 'Registers a binding of "nearTokenAccountId:auroraTokenAddress" in "SiloToSilo" contract.') + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { registerToken } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await registerToken(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); + }); + + +task('get_token_near_account_id', 'Get Token Near Account Id from SiloToSilo') + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { getTokenNearAccountId } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await getTokenNearAccountId(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); + }); + +task('storage_deposit', 'Puts a storage deposit in "nearTokenAccountId" for the "SiloToSilo" implicit NEAR Account ID.') + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { storageDeposit } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await storageDeposit(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); + }); + +task('is_storage_registered', 'Check is storage registered for token') + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { isStorageRegistered } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await isStorageRegistered(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); + }); + +task('safe_ft_transfer_call_to_near', 'Init ft transfer call on Near') + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam("receiverId", "Receiver Id") + .addParam("amount", "Transferred tokens amount") + .addParam('msg', "Msg for ft_transfer_call") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { safeFtTransferCallToNear } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await safeFtTransferCallToNear(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId, taskArgs.amount, taskArgs.msg); + }); + +task('ft_transfer_call_to_near', 'Init ft transfer call on Near') + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam("receiverId", "Receiver Id") + .addParam("amount", "Transferred tokens amount") + .addParam('msg', "Msg for ft_transfer_call") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { ftTransferCallToNear } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await ftTransferCallToNear(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId, taskArgs.amount, taskArgs.msg); + }); + +task('recipient_storage_deposit', "Storage Deposit for Recipient") + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam("receiverId", "Receiver Id") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { recipientStorageDeposit } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await recipientStorageDeposit(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId); + }); + +task('is_recipient_storage_registered', "Check if Storage Deposited for Recipient") + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam("receiverId", "Receiver Id") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { isRecipientStorageRegistered } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await isRecipientStorageRegistered(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId); + }); + +task('get_user_balance', "Get user balance") + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { getUserBalance } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await getUserBalance(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); + }); + +task('withdraw', "Withdraw tokens") + .addParam("silo", "Config file name without extension") + .addParam("proxy", "Current proxy address of the SiloToSilo contract") + .addParam('auroraTokenAddress', "Token address on Aurora") + .setAction(async taskArgs => { + const { withdraw } = require('./utils/scripts.js'); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); + + await withdraw(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); + }); + +task("deploy-sdk", "Deploy aurora sdk").setAction(async (_, hre) => { + const { deploySDK } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + + await hre.run("compile"); + await deploySDK({ + signer, + }); +}); + module.exports = { solidity: { version: "0.8.21", @@ -50,6 +189,11 @@ module.exports = { }, }, networks: { + mainnet_aurora: { + url: 'https://mainnet.aurora.dev', + accounts: [`0x${AURORA_PRIVATE_KEY}`], + chainId: 1313161554, + }, testnet_aurora: { url: "https://testnet.aurora.dev", accounts: [`0x${AURORA_PRIVATE_KEY}`], @@ -59,6 +203,10 @@ module.exports = { url: "https://develop.rpc.testnet.aurora.dev:8545", accounts: [`0x${AURORA_PRIVATE_KEY}`], }, + enpower_silo_aurora: { + url: "https://enpower.aurora.dev", + accounts: [`0x${AURORA_PRIVATE_KEY}`], + } }, mocha: { timeout: 100000000, diff --git a/silo-to-silo/utils/scripts.js b/silo-to-silo/utils/scripts.js index d74804ae..13bbd4bd 100644 --- a/silo-to-silo/utils/scripts.js +++ b/silo-to-silo/utils/scripts.js @@ -42,6 +42,26 @@ async function deploy({ ); } +async function deploySDK({ signer }) { + let utilsLib = await ethers.deployContract("Utils", { signer }); + await utilsLib.waitForDeployment(); + console.log("Utils lib deployed to: ", await utilsLib.getAddress()); + + let codecLib = await ethers.deployContract("Codec", { signer }); + await codecLib.waitForDeployment(); + console.log("Codec lib deployed to: ", await codecLib.getAddress()); + + const sdkLib = await ethers.deployContract("AuroraSdk", { + signer, + libraries: { + Utils: await utilsLib.getAddress(), + Codec: await codecLib.getAddress(), + }, + }); + await sdkLib.waitForDeployment(); + console.log("SDK lib deployed to: ", await sdkLib.getAddress()); +} + async function upgrade({ signer, proxyAddress, @@ -50,22 +70,22 @@ async function upgrade({ }) { console.log("Upgrading contracts with the account:", signer.address); console.log( - "Account balance:", - (await signer.provider.getBalance(signer.address)).toString(), + "Account balance:", + (await signer.provider.getBalance(signer.address)).toString(), ); const SiloToSiloContract = ( - await ethers.getContractFactory("SiloToSilo", { - libraries: { - AuroraSdk: auroraSdkAddress, - Utils: auroraUtilsAddress, - }, - }) + await ethers.getContractFactory("SiloToSilo", { + libraries: { + AuroraSdk: auroraSdkAddress, + Utils: auroraUtilsAddress, + }, + }) ).connect(signer); console.log( - "Current implementation address:", - await upgrades.erc1967.getImplementationAddress(proxyAddress), + "Current implementation address:", + await upgrades.erc1967.getImplementationAddress(proxyAddress), ); console.log("Upgrade SiloToSilo contract, proxy address", proxyAddress); const proxy = await upgrades.upgradeProxy(proxyAddress, SiloToSiloContract, { @@ -75,10 +95,120 @@ async function upgrade({ await proxy.waitForDeployment(); console.log( - "SiloToSilo impl deployed to: ", - await upgrades.erc1967.getImplementationAddress(await proxy.getAddress()), + "SiloToSilo impl deployed to: ", + await upgrades.erc1967.getImplementationAddress(await proxy.getAddress()), ); } +async function registerToken(signer, config, proxy, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); + await wnear.approve(proxy, "2000000000000000000000000"); + + await siloToSilo.registerToken(auroraTokenAddress); +} + +async function getTokenNearAccountId(signer, config, proxy, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + console.log("Near Account Id for Token: ", await siloToSilo.getTokenAccountId(auroraTokenAddress)); +} + +async function storageDeposit(signer, config, proxy, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); + await wnear.approve(proxy, "12500000000000000000000"); + + await siloToSilo.storageDeposit(auroraTokenAddress, "12500000000000000000000"); +} + + +async function isStorageRegistered(signer, config, proxy, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + console.log("Is Storage Registered: ", await siloToSilo.isStorageRegistered(auroraTokenAddress)); +} + +async function safeFtTransferCallToNear(signer, config, proxy, auroraTokenAddress, receiverId, amount, msg) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); + await wnear.transfer(siloToSilo, 1); + + const token = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", auroraTokenAddress); + await token.approve(proxy, amount); + + await siloToSilo.safeFtTransferCallToNear(auroraTokenAddress, amount, receiverId, msg); +} + +async function ftTransferCallToNear(signer, config, proxy, auroraTokenAddress, receiverId, amount, msg) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); + await wnear.transfer(siloToSilo, 1); + + const token = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", auroraTokenAddress); + await token.approve(proxy, amount); + + await siloToSilo.ftTransferCallToNear(auroraTokenAddress, amount, receiverId, msg); +} + +async function recipientStorageDeposit(signer, config, proxy, auroraTokenAddress, receiverId) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); + await wnear.approve(proxy, "12500000000000000000000"); + + await siloToSilo.recipientStorageDeposit(auroraTokenAddress, "12500000000000000000000", receiverId); +} + +async function isRecipientStorageRegistered(signer, config, proxy, auroraTokenAddress, receiverId) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + console.log("Is Storage Registered: ", await siloToSilo.isRecipientStorageRegistered(auroraTokenAddress, receiverId)); +} + +async function getUserBalance(signer, config, proxy, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + console.log("User balance: ", await siloToSilo.getUserBalance(auroraTokenAddress, signer.address)); +} + +async function withdraw(signer, config, proxy, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config, proxy); + + const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); + await wnear.transfer(siloToSilo, 1); + + await siloToSilo.withdraw(auroraTokenAddress); +} + +async function getSiloToSiloContract(signer, config, proxy) { + console.log("Sending transaction with the account:", signer.address); + + const SiloToSilo = await hre.ethers.getContractFactory("SiloToSilo", { + libraries: { + "AuroraSdk": config.auroraSdkAddress, + "Utils": config.auroraUtilsAddress + }, + }); + + return SiloToSilo + .attach(proxy) + .connect(signer); +} + exports.deploy = deploy; exports.upgrade = upgrade; +exports.registerToken = registerToken; +exports.getTokenNearAccountId = getTokenNearAccountId; +exports.storageDeposit = storageDeposit; +exports.isStorageRegistered = isStorageRegistered; +exports.safeFtTransferCallToNear = safeFtTransferCallToNear; +exports.ftTransferCallToNear = ftTransferCallToNear; +exports.recipientStorageDeposit = recipientStorageDeposit; +exports.isRecipientStorageRegistered = isRecipientStorageRegistered; +exports.getUserBalance = getUserBalance; +exports.withdraw = withdraw; +exports.deploySDK = deploySDK; From abc94c90967494d60c9784ca6c387a24cc8c5441 Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 12 Oct 2023 19:21:10 +0100 Subject: [PATCH 40/50] Revert toolchain update --- silo-to-silo/integration-tests/rust-toolchain | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/silo-to-silo/integration-tests/rust-toolchain b/silo-to-silo/integration-tests/rust-toolchain index 5299106e..a6b7f76d 100644 --- a/silo-to-silo/integration-tests/rust-toolchain +++ b/silo-to-silo/integration-tests/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "1.70.0" -components = ["clippy", "rustfmt"] +channel = "1.66.1" +components = ["clippy", "rustfmt"] \ No newline at end of file From cb8ff916385fd4675cb43bb4b95ded002e7bc44c Mon Sep 17 00:00:00 2001 From: karim-en Date: Mon, 11 Dec 2023 20:13:59 +0000 Subject: [PATCH 41/50] Transfer wNEAR on storage deposit --- silo-to-silo/contracts/src/SiloToSilo.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index f1c90676..f8bd146c 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -136,6 +136,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, ) private { string memory nearTokenAccountId = registeredTokens[token].nearTokenAccountId; require(bytes(nearTokenAccountId).length > 0, "The token is not registered"); + near.wNEAR.transferFrom(msg.sender, address(this), storageDepositAmount); PromiseCreateArgs memory callStorageDeposit = near.call( nearTokenAccountId, From 4a0076d963ccd4c6085f3e5fc2e2e68a54395fbc Mon Sep 17 00:00:00 2001 From: karim-en Date: Tue, 12 Dec 2023 00:27:50 +0000 Subject: [PATCH 42/50] Use proxy address from the config --- .../.openzeppelin/unknown-1313161554.json | 282 +++++++++++++++++ silo-to-silo/Makefile | 26 +- silo-to-silo/configs/aurora-mainnet.json | 5 +- silo-to-silo/hardhat.config.js | 297 ++++++++++-------- silo-to-silo/package.json | 3 +- silo-to-silo/utils/scripts.js | 212 +++++++++---- silo-to-silo/yarn.lock | 95 +++++- 7 files changed, 712 insertions(+), 208 deletions(-) create mode 100644 silo-to-silo/.openzeppelin/unknown-1313161554.json diff --git a/silo-to-silo/.openzeppelin/unknown-1313161554.json b/silo-to-silo/.openzeppelin/unknown-1313161554.json new file mode 100644 index 00000000..d55ce748 --- /dev/null +++ b/silo-to-silo/.openzeppelin/unknown-1313161554.json @@ -0,0 +1,282 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x055707c67977e8217F98f19cFa8aca18B2282D0C", + "txHash": "0x39014fa65c7d2cd26e22f1a0c593d35889a503b1d66cc32b8b044429a1c989af", + "kind": "uups" + } + ], + "impls": { + "4be53a640504c7324367d855c4afed943991d08a3c507d6adecbdb0fa00175b0": { + "address": "0xF3024a71B3D229bCb6E1d02D48Bd254AA4903387", + "txHash": "0x09147afacde7ee3b05eded7935791c74c44765de0e74653709ddd1c3c1477dc3", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_paused", + "offset": 0, + "slot": "251", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "near", + "offset": 0, + "slot": "301", + "type": "t_struct(NEAR)29_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:37" + }, + { + "label": "siloAccountId", + "offset": 0, + "slot": "302", + "type": "t_string_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:38" + }, + { + "label": "ftTransferCallCounter", + "offset": 0, + "slot": "303", + "type": "t_uint256", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:39" + }, + { + "label": "registeredTokens", + "offset": 0, + "slot": "304", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:42" + }, + { + "label": "balance", + "offset": 0, + "slot": "305", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:45" + }, + { + "label": "registeredRecipients", + "offset": 0, + "slot": "306", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:48" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20)5413": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IEvmErc20)6720": { + "label": "contract IEvmErc20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint128)": { + "label": "mapping(address => uint128)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))": { + "label": "mapping(contract IEvmErc20 => mapping(address => uint128))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))": { + "label": "mapping(contract IEvmErc20 => mapping(string => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)": { + "label": "mapping(contract IEvmErc20 => struct TokenInfo)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_bool)": { + "label": "mapping(string => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(NEAR)29_storage": { + "label": "struct NEAR", + "members": [ + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "wNEAR", + "type": "t_contract(IERC20)5413", + "offset": 1, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(RoleData)1839_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(TokenInfo)6744_storage": { + "label": "struct TokenInfo", + "members": [ + { + "label": "nearTokenAccountId", + "type": "t_string_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "isStorageRegistered", + "type": "t_bool", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} diff --git a/silo-to-silo/Makefile b/silo-to-silo/Makefile index c245484d..91e49f26 100644 --- a/silo-to-silo/Makefile +++ b/silo-to-silo/Makefile @@ -1,9 +1,7 @@ -SILO_TO_SILO_ADDRESS=0xE0302bE5963B1f13003AB3a4798d2853BAE731a7 - NETWORK=mainnet_aurora CONFIG_NAME="aurora-mainnet" -AURORA_TOKEN_ADDRESS="0xB12BFcA5A55806AaF64E99521918A4bf0fC40802" +AURORA_TOKEN_ADDRESS="0xb12bfca5a55806aaf64e99521918a4bf0fc40802" RECEIVER_ID="silo-1.aurora-silo-dev.near" AMOUNT="100000" @@ -13,37 +11,37 @@ deploy: yarn hardhat deploy --silo $(CONFIG_NAME) --network $(NETWORK) upgrade: - yarn hardhat upgrade --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --network $(NETWORK) + yarn hardhat upgrade --silo $(CONFIG_NAME) --network $(NETWORK) register_token: - yarn hardhat register_token --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + yarn hardhat register_token --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) get_token_near_account_id: - yarn hardhat get_token_near_account_id --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + yarn hardhat get_token_near_account_id --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) storage_deposit: - yarn hardhat storage_deposit --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + yarn hardhat storage_deposit --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) is_storage_registered: - yarn hardhat is_storage_registered --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + yarn hardhat is_storage_registered --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) safe_ft_transfer_call_to_near: - yarn hardhat safe_ft_transfer_call_to_near --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --amount $(AMOUNT) --msg $(MSG) --network $(NETWORK) + yarn hardhat safe_ft_transfer_call_to_near --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --amount $(AMOUNT) --msg $(MSG) --network $(NETWORK) ft_transfer_call_to_near: - yarn hardhat ft_transfer_call_to_near --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --amount $(AMOUNT) --msg $(MSG) --network $(NETWORK) + yarn hardhat ft_transfer_call_to_near --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --amount $(AMOUNT) --msg $(MSG) --network $(NETWORK) recipient_storage_deposit: - yarn hardhat recipient_storage_deposit --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --network $(NETWORK) + yarn hardhat recipient_storage_deposit --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --network $(NETWORK) is_recipient_storage_registered: - yarn hardhat is_recipient_storage_registered --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --network $(NETWORK) + yarn hardhat is_recipient_storage_registered --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --receiver-id $(RECEIVER_ID) --network $(NETWORK) get_user_balance: - yarn hardhat get_user_balance --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + yarn hardhat get_user_balance --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) withdraw: - yarn hardhat withdraw --silo $(CONFIG_NAME) --proxy $(SILO_TO_SILO_ADDRESS) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) + yarn hardhat withdraw --silo $(CONFIG_NAME) --aurora-token-address $(AURORA_TOKEN_ADDRESS) --network $(NETWORK) deploySDK: yarn hardhat deploy-sdk --network $(NETWORK) diff --git a/silo-to-silo/configs/aurora-mainnet.json b/silo-to-silo/configs/aurora-mainnet.json index 217848f3..161db60f 100644 --- a/silo-to-silo/configs/aurora-mainnet.json +++ b/silo-to-silo/configs/aurora-mainnet.json @@ -4,5 +4,6 @@ "auroraSdkAddress": "0xc9279246BC677a528a9A28b48Ea67EA898E526a4", "auroraUtilsAddress": "0xF59eFA6A6065674D639d8b5f1FDdADf7F8E5E8E2", "auroraCodecAddress": "0xC042D3F70ADc2f74a1717147f9DDF413fee487C1", - "wNearAddress": "0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d" -} \ No newline at end of file + "wNearAddress": "0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d", + "siloToSiloProxyAddress": "0x055707c67977e8217F98f19cFa8aca18B2282D0C" +} diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index f01d7e36..046e46ef 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -3,6 +3,7 @@ require("@nomicfoundation/hardhat-ethers"); require("@openzeppelin/hardhat-upgrades"); const AURORA_PRIVATE_KEY = process.env.AURORA_PRIVATE_KEY; +const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY; task("deploy", "Deploy silo to silo proxy contract") .addParam("silo", "Config file name without extension") @@ -33,149 +34,171 @@ task("upgrade", "Upgrade silo to silo proxy contract") await hre.run("compile"); await upgrade({ signer, - proxyAddress: taskArgs.proxy, + proxyAddress: config.siloToSiloProxyAddress, auroraSdkAddress: config.auroraSdkAddress, auroraUtilsAddress: config.auroraUtilsAddress, }); }); -task('register_token', 'Registers a binding of "nearTokenAccountId:auroraTokenAddress" in "SiloToSilo" contract.') - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { registerToken } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); +task( + "register_token", + 'Registers a binding of "nearTokenAccountId:auroraTokenAddress" in "SiloToSilo" contract.', +) + .addParam("silo", "Config file name without extension") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { registerToken } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); - await registerToken(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); - }); + await registerToken(signer, config, taskArgs.auroraTokenAddress); + }); +task("get_token_near_account_id", "Get Token Near Account Id from SiloToSilo") + .addParam("silo", "Config file name without extension") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { getTokenNearAccountId } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task('get_token_near_account_id', 'Get Token Near Account Id from SiloToSilo') - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { getTokenNearAccountId } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); + await getTokenNearAccountId(signer, config, taskArgs.auroraTokenAddress); + }); - await getTokenNearAccountId(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); - }); +task( + "storage_deposit", + 'Puts a storage deposit in "nearTokenAccountId" for the "SiloToSilo" implicit NEAR Account ID.', +) + .addParam("silo", "Config file name without extension") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { storageDeposit } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task('storage_deposit', 'Puts a storage deposit in "nearTokenAccountId" for the "SiloToSilo" implicit NEAR Account ID.') - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { storageDeposit } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); + await storageDeposit(signer, config, taskArgs.auroraTokenAddress); + }); - await storageDeposit(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); - }); +task("is_storage_registered", "Check is storage registered for token") + .addParam("silo", "Config file name without extension") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { isStorageRegistered } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task('is_storage_registered', 'Check is storage registered for token') - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { isStorageRegistered } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); + await isStorageRegistered(signer, config, taskArgs.auroraTokenAddress); + }); - await isStorageRegistered(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); - }); +task("safe_ft_transfer_call_to_near", "Init ft transfer call on Near") + .addParam("silo", "Config file name without extension") + .addParam("receiverId", "Receiver Id") + .addParam("amount", "Transferred tokens amount") + .addParam("msg", "Msg for ft_transfer_call") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { safeFtTransferCallToNear } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task('safe_ft_transfer_call_to_near', 'Init ft transfer call on Near') - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam("receiverId", "Receiver Id") - .addParam("amount", "Transferred tokens amount") - .addParam('msg', "Msg for ft_transfer_call") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { safeFtTransferCallToNear } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); - - await safeFtTransferCallToNear(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId, taskArgs.amount, taskArgs.msg); - }); + await safeFtTransferCallToNear( + signer, + config, + taskArgs.auroraTokenAddress, + taskArgs.receiverId, + taskArgs.amount, + taskArgs.msg, + ); + }); -task('ft_transfer_call_to_near', 'Init ft transfer call on Near') - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam("receiverId", "Receiver Id") - .addParam("amount", "Transferred tokens amount") - .addParam('msg', "Msg for ft_transfer_call") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { ftTransferCallToNear } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); - - await ftTransferCallToNear(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId, taskArgs.amount, taskArgs.msg); - }); +task("ft_transfer_call_to_near", "Init ft transfer call on Near") + .addParam("silo", "Config file name without extension") + .addParam("receiverId", "Receiver Id") + .addParam("amount", "Transferred tokens amount") + .addParam("msg", "Msg for ft_transfer_call") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { ftTransferCallToNear } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task('recipient_storage_deposit', "Storage Deposit for Recipient") - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam("receiverId", "Receiver Id") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { recipientStorageDeposit } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); - - await recipientStorageDeposit(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId); - }); + await ftTransferCallToNear( + signer, + config, + taskArgs.auroraTokenAddress, + taskArgs.receiverId, + taskArgs.amount, + taskArgs.msg, + ); + }); -task('is_recipient_storage_registered', "Check if Storage Deposited for Recipient") - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam("receiverId", "Receiver Id") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { isRecipientStorageRegistered } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); - - await isRecipientStorageRegistered(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress, taskArgs.receiverId); - }); +task("recipient_storage_deposit", "Storage Deposit for Recipient") + .addParam("silo", "Config file name without extension") + .addParam("receiverId", "Receiver Id") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { recipientStorageDeposit } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task('get_user_balance', "Get user balance") - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { getUserBalance } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); + await recipientStorageDeposit( + signer, + config, + taskArgs.auroraTokenAddress, + taskArgs.receiverId, + ); + }); - await getUserBalance(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); - }); +task( + "is_recipient_storage_registered", + "Check if Storage Deposited for Recipient", +) + .addParam("silo", "Config file name without extension") + .addParam("receiverId", "Receiver Id") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { isRecipientStorageRegistered } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task('withdraw', "Withdraw tokens") - .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") - .addParam('auroraTokenAddress', "Token address on Aurora") - .setAction(async taskArgs => { - const { withdraw } = require('./utils/scripts.js'); - const [signer] = await hre.ethers.getSigners(); - const config = require(`./configs/${taskArgs.silo}.json`); + await isRecipientStorageRegistered( + signer, + config, + taskArgs.auroraTokenAddress, + taskArgs.receiverId, + ); + }); - await withdraw(signer, config, taskArgs.proxy, taskArgs.auroraTokenAddress); - }); +task("get_user_balance", "Get user balance") + .addParam("silo", "Config file name without extension") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { getUserBalance } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); -task("deploy-sdk", "Deploy aurora sdk").setAction(async (_, hre) => { - const { deploySDK } = require("./utils/scripts.js"); + await getUserBalance(signer, config, taskArgs.auroraTokenAddress); + }); + +task("withdraw", "Withdraw tokens") + .addParam("silo", "Config file name without extension") + .addParam("auroraTokenAddress", "Token address on Aurora") + .setAction(async (taskArgs) => { + const { withdraw } = require("./utils/scripts.js"); const [signer] = await hre.ethers.getSigners(); + const config = require(`./configs/${taskArgs.silo}.json`); - await hre.run("compile"); - await deploySDK({ - signer, - }); + await withdraw(signer, config, taskArgs.auroraTokenAddress); + }); + +task("deploy-sdk", "Deploy aurora sdk").setAction(async (_, hre) => { + const { deploySDK } = require("./utils/scripts.js"); + const [signer] = await hre.ethers.getSigners(); + + await hre.run("compile"); + await deploySDK({ + signer, + }); }); module.exports = { @@ -190,9 +213,9 @@ module.exports = { }, networks: { mainnet_aurora: { - url: 'https://mainnet.aurora.dev', - accounts: [`0x${AURORA_PRIVATE_KEY}`], - chainId: 1313161554, + url: "https://mainnet.aurora.dev", + accounts: [`0x${AURORA_PRIVATE_KEY}`], + chainId: 1313161554, }, testnet_aurora: { url: "https://testnet.aurora.dev", @@ -204,9 +227,33 @@ module.exports = { accounts: [`0x${AURORA_PRIVATE_KEY}`], }, enpower_silo_aurora: { - url: "https://enpower.aurora.dev", - accounts: [`0x${AURORA_PRIVATE_KEY}`], - } + url: "https://enpower.aurora.dev", + accounts: [`0x${AURORA_PRIVATE_KEY}`], + }, + }, + etherscan: { + apiKey: { + mainnet_aurora: `${ETHERSCAN_API_KEY}`, + testnet_aurora: `${ETHERSCAN_API_KEY}`, + }, + customChains: [ + { + network: "mainnet_aurora", + chainId: 1313161554, + urls: { + apiURL: "https://explorer.mainnet.aurora.dev/api", + browserURL: "https://explorer.mainnet.aurora.dev", + }, + }, + { + network: "testnet_aurora", + chainId: 1313161555, + urls: { + apiURL: "https://explorer.testnet.aurora.dev/api", + browserURL: "https://explorer.testnet.aurora.dev", + }, + }, + ], }, mocha: { timeout: 100000000, diff --git a/silo-to-silo/package.json b/silo-to-silo/package.json index f9663c14..220833ac 100644 --- a/silo-to-silo/package.json +++ b/silo-to-silo/package.json @@ -13,6 +13,7 @@ "@openzeppelin/contracts": "^4.9.3", "@openzeppelin/contracts-upgradeable": "^4.9.3", "@openzeppelin/hardhat-upgrades": "^2.2.0", - "dotenv": "^16" + "dotenv": "^16", + "@nomicfoundation/hardhat-verify": "^1.0.0" } } diff --git a/silo-to-silo/utils/scripts.js b/silo-to-silo/utils/scripts.js index 13bbd4bd..1dae3704 100644 --- a/silo-to-silo/utils/scripts.js +++ b/silo-to-silo/utils/scripts.js @@ -70,22 +70,22 @@ async function upgrade({ }) { console.log("Upgrading contracts with the account:", signer.address); console.log( - "Account balance:", - (await signer.provider.getBalance(signer.address)).toString(), + "Account balance:", + (await signer.provider.getBalance(signer.address)).toString(), ); const SiloToSiloContract = ( - await ethers.getContractFactory("SiloToSilo", { - libraries: { - AuroraSdk: auroraSdkAddress, - Utils: auroraUtilsAddress, - }, - }) + await ethers.getContractFactory("SiloToSilo", { + libraries: { + AuroraSdk: auroraSdkAddress, + Utils: auroraUtilsAddress, + }, + }) ).connect(signer); console.log( - "Current implementation address:", - await upgrades.erc1967.getImplementationAddress(proxyAddress), + "Current implementation address:", + await upgrades.erc1967.getImplementationAddress(proxyAddress), ); console.log("Upgrade SiloToSilo contract, proxy address", proxyAddress); const proxy = await upgrades.upgradeProxy(proxyAddress, SiloToSiloContract, { @@ -95,108 +95,194 @@ async function upgrade({ await proxy.waitForDeployment(); console.log( - "SiloToSilo impl deployed to: ", - await upgrades.erc1967.getImplementationAddress(await proxy.getAddress()), + "SiloToSilo impl deployed to: ", + await upgrades.erc1967.getImplementationAddress(await proxy.getAddress()), ); } -async function registerToken(signer, config, proxy, auroraTokenAddress) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); +async function registerToken(signer, config, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config); - const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); - await wnear.approve(proxy, "2000000000000000000000000"); + const wnear = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + config.wNearAddress, + ); + await wnear.approve( + config.siloToSiloProxyAddress, + "2000000000000000000000000", + ); await siloToSilo.registerToken(auroraTokenAddress); } -async function getTokenNearAccountId(signer, config, proxy, auroraTokenAddress) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); - console.log("Near Account Id for Token: ", await siloToSilo.getTokenAccountId(auroraTokenAddress)); +async function getTokenNearAccountId(signer, config, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config); + console.log( + "Near Account Id for Token: ", + await siloToSilo.getTokenAccountId(auroraTokenAddress), + ); } -async function storageDeposit(signer, config, proxy, auroraTokenAddress) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); +async function storageDeposit(signer, config, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config); - const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); - await wnear.approve(proxy, "12500000000000000000000"); + const wnear = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + config.wNearAddress, + ); + await wnear.approve( + config.siloToSiloProxyAddress, + "1000000000000000000000000", + ); - await siloToSilo.storageDeposit(auroraTokenAddress, "12500000000000000000000"); + await siloToSilo.storageDeposit( + auroraTokenAddress, + "12500000000000000000000", + ); } +async function isStorageRegistered(signer, config, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config); -async function isStorageRegistered(signer, config, proxy, auroraTokenAddress) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); - - console.log("Is Storage Registered: ", await siloToSilo.isStorageRegistered(auroraTokenAddress)); + console.log( + "Is Storage Registered: ", + await siloToSilo.isStorageRegistered(auroraTokenAddress), + ); } -async function safeFtTransferCallToNear(signer, config, proxy, auroraTokenAddress, receiverId, amount, msg) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); - - const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); +async function safeFtTransferCallToNear( + signer, + config, + auroraTokenAddress, + receiverId, + amount, + msg, +) { + const siloToSilo = await getSiloToSiloContract(signer, config); + + const wnear = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + config.wNearAddress, + ); await wnear.transfer(siloToSilo, 1); - const token = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", auroraTokenAddress); - await token.approve(proxy, amount); + const token = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + auroraTokenAddress, + ); + await token.approve(config.siloToSiloProxyAddress, amount); - await siloToSilo.safeFtTransferCallToNear(auroraTokenAddress, amount, receiverId, msg); + await siloToSilo.safeFtTransferCallToNear( + auroraTokenAddress, + amount, + receiverId, + msg, + ); } -async function ftTransferCallToNear(signer, config, proxy, auroraTokenAddress, receiverId, amount, msg) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); - - const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); +async function ftTransferCallToNear( + signer, + config, + auroraTokenAddress, + receiverId, + amount, + msg, +) { + const siloToSilo = await getSiloToSiloContract(signer, config); + + const wnear = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + config.wNearAddress, + ); await wnear.transfer(siloToSilo, 1); - const token = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", auroraTokenAddress); - await token.approve(proxy, amount); + const token = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + auroraTokenAddress, + ); + await token.approve(config.siloToSiloProxyAddress, amount); - await siloToSilo.ftTransferCallToNear(auroraTokenAddress, amount, receiverId, msg); + await siloToSilo.ftTransferCallToNear( + auroraTokenAddress, + amount, + receiverId, + msg, + ); } -async function recipientStorageDeposit(signer, config, proxy, auroraTokenAddress, receiverId) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); - - const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); - await wnear.approve(proxy, "12500000000000000000000"); +async function recipientStorageDeposit( + signer, + config, + auroraTokenAddress, + receiverId, +) { + const siloToSilo = await getSiloToSiloContract(signer, config); + + const wnear = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + config.wNearAddress, + ); + await wnear.approve( + config.siloToSiloProxyAddress, + "1000000000000000000000000", + ); - await siloToSilo.recipientStorageDeposit(auroraTokenAddress, "12500000000000000000000", receiverId); + await siloToSilo.recipientStorageDeposit( + auroraTokenAddress, + "12500000000000000000000", + receiverId, + ); } -async function isRecipientStorageRegistered(signer, config, proxy, auroraTokenAddress, receiverId) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); +async function isRecipientStorageRegistered( + signer, + config, + auroraTokenAddress, + receiverId, +) { + const siloToSilo = await getSiloToSiloContract(signer, config); - console.log("Is Storage Registered: ", await siloToSilo.isRecipientStorageRegistered(auroraTokenAddress, receiverId)); + console.log( + "Is Storage Registered: ", + await siloToSilo.isRecipientStorageRegistered( + auroraTokenAddress, + receiverId, + ), + ); } -async function getUserBalance(signer, config, proxy, auroraTokenAddress) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); +async function getUserBalance(signer, config, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config); - console.log("User balance: ", await siloToSilo.getUserBalance(auroraTokenAddress, signer.address)); + console.log( + "User balance: ", + await siloToSilo.getUserBalance(auroraTokenAddress, signer.address), + ); } -async function withdraw(signer, config, proxy, auroraTokenAddress) { - const siloToSilo = await getSiloToSiloContract(signer, config, proxy); +async function withdraw(signer, config, auroraTokenAddress) { + const siloToSilo = await getSiloToSiloContract(signer, config); - const wnear = await hre.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", config.wNearAddress); + const wnear = await hre.ethers.getContractAt( + "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", + config.wNearAddress, + ); await wnear.transfer(siloToSilo, 1); await siloToSilo.withdraw(auroraTokenAddress); } -async function getSiloToSiloContract(signer, config, proxy) { +async function getSiloToSiloContract(signer, config) { console.log("Sending transaction with the account:", signer.address); const SiloToSilo = await hre.ethers.getContractFactory("SiloToSilo", { libraries: { - "AuroraSdk": config.auroraSdkAddress, - "Utils": config.auroraUtilsAddress + AuroraSdk: config.auroraSdkAddress, + Utils: config.auroraUtilsAddress, }, }); - return SiloToSilo - .attach(proxy) - .connect(signer); + return SiloToSilo.attach(config.siloToSiloProxyAddress).connect(signer); } exports.deploy = deploy; diff --git a/silo-to-silo/yarn.lock b/silo-to-silo/yarn.lock index a8d0f5f1..0cfa95dd 100644 --- a/silo-to-silo/yarn.lock +++ b/silo-to-silo/yarn.lock @@ -122,7 +122,7 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== @@ -593,6 +593,21 @@ debug "^4.1.1" lodash.isequal "^4.5.0" +"@nomicfoundation/hardhat-verify@^1.0.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-1.1.1.tgz#6a433d777ce0172d1f0edf7f2d3e1df14b3ecfc1" + integrity sha512-9QsTYD7pcZaQFEA3tBb/D/oCStYDiEVDN7Dxeo/4SCyHRSm86APypxxdOMEPlGmXsAvd+p1j/dTODcpxb8aztA== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^8.1.0" + chalk "^2.4.2" + debug "^4.1.1" + lodash.clonedeep "^4.5.0" + semver "^6.3.0" + table "^6.8.0" + undici "^5.14.0" + "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" @@ -934,6 +949,16 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" +ajv@^8.0.1: + version "8.12.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" + integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + amazon-cognito-identity-js@^6.0.1: version "6.3.3" resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-6.3.3.tgz#d301309827aa7d74d6e3892cc27f25332c5cba3c" @@ -999,6 +1024,11 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + async-retry@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" @@ -1191,6 +1221,13 @@ catering@^2.1.0, catering@^2.1.1: resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== +cbor@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" + integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== + dependencies: + nofilter "^3.1.0" + cbor@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/cbor/-/cbor-9.0.1.tgz#b16e393d4948d44758cd54ac6151379d443b37ae" @@ -1562,6 +1599,11 @@ fast-base64-decode@^1.0.0: resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418" integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q== +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -1929,6 +1971,11 @@ js-yaml@4.1.0: dependencies: argparse "^2.0.1" +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -1995,11 +2042,21 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== + lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== + lodash@^4.17.11, lodash@^4.17.19: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -2308,6 +2365,11 @@ proxy-from-env@^1.1.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== +punycode@^2.1.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + queue-microtask@^1.2.2, queue-microtask@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -2351,7 +2413,7 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-from-string@^2.0.0: +require-from-string@^2.0.0, require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== @@ -2483,6 +2545,15 @@ signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" @@ -2538,7 +2609,7 @@ streamsearch@^1.1.0: resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== -string-width@^4.1.0, string-width@^4.2.0: +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -2594,6 +2665,17 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +table@^6.8.0: + version "6.8.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf" + integrity sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA== + dependencies: + ajv "^8.0.1" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + tmp@0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -2680,6 +2762,13 @@ unpipe@1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" From bd9892b2c743a768e621ab22ed8622d49e664e3a Mon Sep 17 00:00:00 2001 From: karim-en Date: Tue, 12 Dec 2023 00:28:21 +0000 Subject: [PATCH 43/50] Apply fmt --- silo-to-silo/integration-tests/src/lib.rs | 327 +++++++++++++++------- 1 file changed, 225 insertions(+), 102 deletions(-) diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index db74aa18..b96667d7 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -1,7 +1,10 @@ #[cfg(test)] mod tests { use aurora_sdk_integration_tests::aurora_engine::erc20::ERC20; - use aurora_sdk_integration_tests::aurora_engine_types::parameters::engine::{FunctionCallArgsV2, SubmitResult, TransactionStatus}; + use aurora_sdk_integration_tests::aurora_engine_types::parameters::engine::{ + FunctionCallArgsV2, SubmitResult, TransactionStatus, + }; + use aurora_sdk_integration_tests::aurora_engine_types::types::WeiU256; use aurora_sdk_integration_tests::aurora_engine_types::H160; use aurora_sdk_integration_tests::wnear::Wnear; use aurora_sdk_integration_tests::workspaces::network::Sandbox; @@ -20,7 +23,6 @@ mod tests { workspaces::{self, AccountId}, }; use std::path::Path; - use aurora_sdk_integration_tests::aurora_engine_types::types::WeiU256; const ONE_NEAR: u128 = 1_000_000_000_000_000_000_000_000; @@ -117,7 +119,11 @@ mod tests { pub async fn mint_eth_engine(&self, user_address: Option
, amount: u64) { self.engine - .mint_account(user_address.unwrap_or(self.user_address.clone()), 0, Wei::new_u64(amount)) + .mint_account( + user_address.unwrap_or(self.user_address.clone()), + 0, + Wei::new_u64(amount), + ) .await .unwrap(); } @@ -456,7 +462,8 @@ mod tests { infra.mint_wnear_engine(None).await; infra.approve_spend_wnear_engine(None).await; - let implicit_account = infra.engine_silo_to_silo_contract.address.encode() + "." + infra.engine.inner.id(); + let implicit_account = + infra.engine_silo_to_silo_contract.address.encode() + "." + infra.engine.inner.id(); storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; storage_deposit(&infra.mock_token, infra.silo.inner.id(), None).await; @@ -509,15 +516,17 @@ mod tests { infra.approve_spend_mock_tokens_engine().await; - let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( - "ftTransferCallToNear", - &[ - ethabi::Token::Address(infra.engine_mock_token.address.raw()), - ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), - ethabi::Token::String(infra.silo.inner.id().to_string()), - ethabi::Token::String(msg), - ], - ); + let contract_args = infra + .engine_silo_to_silo_contract + .create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address(infra.engine_mock_token.address.raw()), + ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(msg), + ], + ); let _ = call_aurora_contract( infra.engine_silo_to_silo_contract.address, @@ -526,20 +535,25 @@ mod tests { infra.engine.inner.id(), 0, false, - ).await; + ) + .await; let balance_engine_after = infra.get_mock_token_balance_engine().await; if balance_engine_after.as_u64() == 0 { let balance_silo = infra.get_mock_token_balance_silo().await; assert_eq!(balance_silo.as_u64(), 0); - infra.check_user_balance_engine((i + 1) * TRANSFER_TOKENS_AMOUNT).await; + infra + .check_user_balance_engine((i + 1) * TRANSFER_TOKENS_AMOUNT) + .await; step = step * 2; msg_len += step; } else { assert_eq!(balance_engine_after.as_u64(), TRANSFER_TOKENS_AMOUNT); let balance_silo = infra.get_mock_token_balance_silo().await; assert_eq!(balance_silo.as_u64(), 0); - infra.check_user_balance_engine(i * TRANSFER_TOKENS_AMOUNT).await; + infra + .check_user_balance_engine(i * TRANSFER_TOKENS_AMOUNT) + .await; break; } } @@ -551,22 +565,34 @@ mod tests { mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; infra.mint_wnear_engine(None).await; - infra.mint_wnear_engine(Some(infra.engine_silo_to_silo_contract.address)).await; + infra + .mint_wnear_engine(Some(infra.engine_silo_to_silo_contract.address)) + .await; infra.approve_spend_wnear_engine(None).await; infra.mint_eth_engine(None, 200).await; - let silo_eth_token = infra.silo.bridge_nep141(infra.engine.inner.id()).await.unwrap(); + let silo_eth_token = infra + .silo + .bridge_nep141(infra.engine.inner.id()) + .await + .unwrap(); storage_deposit(&infra.engine.inner, infra.engine.inner.id(), None).await; storage_deposit(&infra.engine.inner, infra.silo.inner.id(), None).await; - let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( - "storageDeposit", - &[ - ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), - ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), - ], - ); + let contract_args = infra + .engine_silo_to_silo_contract + .create_call_method_bytes_with_args( + "storageDeposit", + &[ + ethabi::Token::Address( + "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(), + ), + ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), + ], + ); call_aurora_contract( infra.engine_silo_to_silo_contract.address, @@ -576,28 +602,41 @@ mod tests { 0, true, ) - .await - .unwrap(); + .await + .unwrap(); - let user_balance_before = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + let user_balance_before = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(user_balance_before, 200); - let user_balance_before_silo = infra.silo + let user_balance_before_silo = infra + .silo .erc20_balance_of(&silo_eth_token, infra.user_address) .await .unwrap(); assert_eq!(user_balance_before_silo.as_u64(), 0); - let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( - "ftTransferCallToNear", - &[ - ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), - ethabi::Token::Uint(U256::from(200)), - ethabi::Token::String(infra.silo.inner.id().to_string()), - ethabi::Token::String(infra.user_address.encode()), - ], - ); + let contract_args = infra + .engine_silo_to_silo_contract + .create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address( + "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(), + ), + ethabi::Token::Uint(U256::from(200)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(infra.user_address.encode()), + ], + ); call_aurora_contract( infra.engine_silo_to_silo_contract.address, @@ -606,12 +645,21 @@ mod tests { infra.engine.inner.id(), 200, true, - ).await.unwrap(); + ) + .await + .unwrap(); - let user_balance_after = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + let user_balance_after = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(user_balance_after, 0); - let user_balance_after_silo = infra.silo + let user_balance_after_silo = infra + .silo .erc20_balance_of(&silo_eth_token, infra.user_address) .await .unwrap(); @@ -628,26 +676,33 @@ mod tests { &infra.user_account, &infra.silo, true, - ).await; + ) + .await; approve_spend_tokens( &silo_eth_token, infra.silo_silo_to_silo_contract.address, &infra.user_account, &infra.silo, - ).await; + ) + .await; infra.silo_to_engine_transfer().await; - let contract_args = infra.silo_silo_to_silo_contract.create_call_method_bytes_with_args( - "ftTransferCallToNear", - &[ - ethabi::Token::Address(silo_eth_token.address.raw()), - ethabi::Token::Uint(U256::from(200)), - ethabi::Token::String(infra.engine.inner.id().to_string()), - ethabi::Token::String("fake.near:0000000000000000000000000000000000000000000000000000000000000000".to_string() + &infra.user_address.encode()), - ], - ); + let contract_args = infra + .silo_silo_to_silo_contract + .create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address(silo_eth_token.address.raw()), + ethabi::Token::Uint(U256::from(200)), + ethabi::Token::String(infra.engine.inner.id().to_string()), + ethabi::Token::String( + "fake.near:0000000000000000000000000000000000000000000000000000000000000000" + .to_string() + &infra.user_address.encode(), + ), + ], + ); call_aurora_contract( infra.silo_silo_to_silo_contract.address, @@ -656,12 +711,21 @@ mod tests { infra.silo.inner.id(), 0, true, - ).await.unwrap(); + ) + .await + .unwrap(); - let user_balance_after_back_transfer = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + let user_balance_after_back_transfer = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(user_balance_after_back_transfer, 200); - let user_balance_after_back_transfer_silo = infra.silo + let user_balance_after_back_transfer_silo = infra + .silo .erc20_balance_of(&silo_eth_token, infra.user_address) .await .unwrap(); @@ -675,18 +739,26 @@ mod tests { mint_tokens_near(&infra.mock_token, infra.engine.inner.id()).await; infra.mint_wnear_engine(None).await; - infra.mint_wnear_engine(Some(infra.engine_silo_to_silo_contract.address)).await; + infra + .mint_wnear_engine(Some(infra.engine_silo_to_silo_contract.address)) + .await; infra.approve_spend_wnear_engine(None).await; infra.mint_eth_engine(None, 200).await; - - let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( - "storageDeposit", - &[ - ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), - ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), - ], - ); + + let contract_args = infra + .engine_silo_to_silo_contract + .create_call_method_bytes_with_args( + "storageDeposit", + &[ + ethabi::Token::Address( + "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(), + ), + ethabi::Token::Uint(NEP141_STORAGE_DEPOSIT.into()), + ], + ); call_aurora_contract( infra.engine_silo_to_silo_contract.address, @@ -696,21 +768,33 @@ mod tests { 0, true, ) - .await - .unwrap(); + .await + .unwrap(); - let user_balance_before = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + let user_balance_before = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(user_balance_before, 200); - let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( - "ftTransferCallToNear", - &[ - ethabi::Token::Address("0x0000000000000000000000000000000000000000".parse().unwrap()), - ethabi::Token::Uint(U256::from(200)), - ethabi::Token::String(infra.silo.inner.id().to_string()), - ethabi::Token::String(infra.user_address.encode()), - ], - ); + let contract_args = infra + .engine_silo_to_silo_contract + .create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address( + "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(), + ), + ethabi::Token::Uint(U256::from(200)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(infra.user_address.encode()), + ], + ); call_aurora_contract( infra.engine_silo_to_silo_contract.address, @@ -719,41 +803,64 @@ mod tests { infra.engine.inner.id(), 200, true, - ).await.unwrap(); + ) + .await + .unwrap(); - let user_balance_after = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + let user_balance_after = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(user_balance_after, 0); check_get_user_balance( &infra.engine_silo_to_silo_contract, &infra.user_account, - "0x0000000000000000000000000000000000000000".parse().unwrap(), + "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(), infra.user_address.raw(), &infra.engine, 200, - ).await; + ) + .await; withdraw( &infra.engine_silo_to_silo_contract, - "0x0000000000000000000000000000000000000000".parse().unwrap(), + "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(), infra.engine.inner.id(), infra.user_account.clone(), - ).await; + ) + .await; - let balance_engine_after_withdraw = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + let balance_engine_after_withdraw = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(balance_engine_after_withdraw, 200); check_get_user_balance( &infra.engine_silo_to_silo_contract, &infra.user_account, - "0x0000000000000000000000000000000000000000".parse().unwrap(), + "0x0000000000000000000000000000000000000000" + .parse() + .unwrap(), infra.user_address.raw(), &infra.engine, 0, - ).await; + ) + .await; } - #[tokio::test] + #[tokio::test] async fn test_ft_transfer_to_silo_with_incorrect_deposit() { let infra = TestsInfrastructure::init(None).await; @@ -769,7 +876,7 @@ mod tests { &infra.user_account, &infra.engine, ) - .await; + .await; storage_deposit(&infra.mock_token, infra.engine.inner.id(), None).await; storage_deposit(&infra.mock_token, infra.silo.inner.id(), None).await; @@ -780,18 +887,26 @@ mod tests { let balance_engine_before = infra.get_mock_token_balance_engine().await; - let mut user_eth_balance = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + let mut user_eth_balance = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(user_eth_balance, TRANSFER_TOKENS_AMOUNT); - let contract_args = infra.engine_silo_to_silo_contract.create_call_method_bytes_with_args( - "ftTransferCallToNear", - &[ - ethabi::Token::Address(infra.engine_mock_token.address.raw()), - ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), - ethabi::Token::String(infra.silo.inner.id().to_string()), - ethabi::Token::String(infra.user_address.encode()), - ], - ); + let contract_args = infra + .engine_silo_to_silo_contract + .create_call_method_bytes_with_args( + "ftTransferCallToNear", + &[ + ethabi::Token::Address(infra.engine_mock_token.address.raw()), + ethabi::Token::Uint(U256::from(TRANSFER_TOKENS_AMOUNT)), + ethabi::Token::String(infra.silo.inner.id().to_string()), + ethabi::Token::String(infra.user_address.encode()), + ], + ); call_aurora_contract( infra.engine_silo_to_silo_contract.address, @@ -800,9 +915,17 @@ mod tests { infra.engine.inner.id(), TRANSFER_TOKENS_AMOUNT as u128, true, - ).await.unwrap(); + ) + .await + .unwrap(); - user_eth_balance = infra.engine.get_balance(infra.user_address).await.unwrap().raw().as_u64(); + user_eth_balance = infra + .engine + .get_balance(infra.user_address) + .await + .unwrap() + .raw() + .as_u64(); assert_eq!(user_eth_balance, TRANSFER_TOKENS_AMOUNT); let balance_engine_after = infra.get_mock_token_balance_engine().await; @@ -923,7 +1046,7 @@ mod tests { &[ ethabi::Token::Address(wnear.aurora_token.address.raw()), ethabi::Token::String(engine.inner.id().to_string()), - ethabi::Token::String(engine.inner.id().to_string()) + ethabi::Token::String(engine.inner.id().to_string()), ], ); call_aurora_contract( @@ -1076,8 +1199,8 @@ mod tests { user_account: &Account, engine: &AuroraEngine, ) { - let contract_args = - silo_to_silo_contract.create_call_method_bytes_with_args("getImplicitNearAccountIdForSelf", &[]); + let contract_args = silo_to_silo_contract + .create_call_method_bytes_with_args("getImplicitNearAccountIdForSelf", &[]); let outcome = call_aurora_contract( silo_to_silo_contract.address, From f6fc53a437df598d9d67be92bd4eec06ff6c2025 Mon Sep 17 00:00:00 2001 From: karim-en Date: Tue, 12 Dec 2023 18:29:51 +0000 Subject: [PATCH 44/50] Remove deprecated code --- silo-to-silo/contracts/src/SiloToSilo.sol | 1 - silo-to-silo/utils/scripts.js | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index f8bd146c..32e4c88b 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -27,7 +27,6 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, bytes32 public constant UNPAUSE_ADMIN_ROLE = keccak256("UNPAUSE_ADMIN_ROLE"); uint64 constant BASE_NEAR_GAS = 10_000_000_000_000; - uint64 constant WITHDRAW_NEAR_GAS = 50_000_000_000_000; uint64 constant FT_TRANSFER_CALL_NEAR_GAS = 150_000_000_000_000; uint128 constant ASCII_0 = 48; uint128 constant ASCII_9 = 57; diff --git a/silo-to-silo/utils/scripts.js b/silo-to-silo/utils/scripts.js index 1dae3704..f096d8ef 100644 --- a/silo-to-silo/utils/scripts.js +++ b/silo-to-silo/utils/scripts.js @@ -159,13 +159,6 @@ async function safeFtTransferCallToNear( msg, ) { const siloToSilo = await getSiloToSiloContract(signer, config); - - const wnear = await hre.ethers.getContractAt( - "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", - config.wNearAddress, - ); - await wnear.transfer(siloToSilo, 1); - const token = await hre.ethers.getContractAt( "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", auroraTokenAddress, @@ -190,12 +183,6 @@ async function ftTransferCallToNear( ) { const siloToSilo = await getSiloToSiloContract(signer, config); - const wnear = await hre.ethers.getContractAt( - "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", - config.wNearAddress, - ); - await wnear.transfer(siloToSilo, 1); - const token = await hre.ethers.getContractAt( "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", auroraTokenAddress, @@ -262,13 +249,6 @@ async function getUserBalance(signer, config, auroraTokenAddress) { async function withdraw(signer, config, auroraTokenAddress) { const siloToSilo = await getSiloToSiloContract(signer, config); - - const wnear = await hre.ethers.getContractAt( - "@openzeppelin/contracts/token/ERC20/IERC20.sol:IERC20", - config.wNearAddress, - ); - await wnear.transfer(siloToSilo, 1); - await siloToSilo.withdraw(auroraTokenAddress); } From 66042ba3f431887d43ce0fb7fcc41ceca7ba6561 Mon Sep 17 00:00:00 2001 From: karim-en Date: Wed, 20 Dec 2023 23:25:52 +0000 Subject: [PATCH 45/50] Deploy on enpower silo --- .../.openzeppelin/unknown-1313161560.json | 282 ++++++++++++++++++ silo-to-silo/configs/enpower-mainnet.json | 9 + .../configs/enpower-silo-testnet.json | 6 - silo-to-silo/hardhat.config.js | 14 +- 4 files changed, 302 insertions(+), 9 deletions(-) create mode 100644 silo-to-silo/.openzeppelin/unknown-1313161560.json create mode 100644 silo-to-silo/configs/enpower-mainnet.json delete mode 100644 silo-to-silo/configs/enpower-silo-testnet.json diff --git a/silo-to-silo/.openzeppelin/unknown-1313161560.json b/silo-to-silo/.openzeppelin/unknown-1313161560.json new file mode 100644 index 00000000..0c69096c --- /dev/null +++ b/silo-to-silo/.openzeppelin/unknown-1313161560.json @@ -0,0 +1,282 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0xAB73F7deb72dD71954F7EF48eb116f6e96EcCAf2", + "txHash": "0xc80f28d5e9b30e39858d2b18270f72c10d85d0acc1d8b0f6edc4d350cece2e82", + "kind": "uups" + } + ], + "impls": { + "0e6c014f0bb4e2f0ac5f10340262ccf93f77faffc526b9a1fe474faf3ea7fe40": { + "address": "0x93BcaDcCcC02620c2882C2A7e62a868C086C9F07", + "txHash": "0x7accbe4a103e20870ff030c3c257d266762a4596e99b4bfb9c86e5c0f2ed58f5", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_paused", + "offset": 0, + "slot": "251", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "near", + "offset": 0, + "slot": "301", + "type": "t_struct(NEAR)29_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:36" + }, + { + "label": "siloAccountId", + "offset": 0, + "slot": "302", + "type": "t_string_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:37" + }, + { + "label": "ftTransferCallCounter", + "offset": 0, + "slot": "303", + "type": "t_uint256", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:38" + }, + { + "label": "registeredTokens", + "offset": 0, + "slot": "304", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:41" + }, + { + "label": "balance", + "offset": 0, + "slot": "305", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:44" + }, + { + "label": "registeredRecipients", + "offset": 0, + "slot": "306", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:47" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20)5413": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IEvmErc20)6720": { + "label": "contract IEvmErc20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint128)": { + "label": "mapping(address => uint128)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))": { + "label": "mapping(contract IEvmErc20 => mapping(address => uint128))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))": { + "label": "mapping(contract IEvmErc20 => mapping(string => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)": { + "label": "mapping(contract IEvmErc20 => struct TokenInfo)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_bool)": { + "label": "mapping(string => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(NEAR)29_storage": { + "label": "struct NEAR", + "members": [ + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "wNEAR", + "type": "t_contract(IERC20)5413", + "offset": 1, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(RoleData)1839_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(TokenInfo)6744_storage": { + "label": "struct TokenInfo", + "members": [ + { + "label": "nearTokenAccountId", + "type": "t_string_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "isStorageRegistered", + "type": "t_bool", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} diff --git a/silo-to-silo/configs/enpower-mainnet.json b/silo-to-silo/configs/enpower-mainnet.json new file mode 100644 index 00000000..d064fb3f --- /dev/null +++ b/silo-to-silo/configs/enpower-mainnet.json @@ -0,0 +1,9 @@ +{ + "siloAccountId": "silo-1.aurora-silo.near", + "nativeTokenAccountId": "aurora", + "auroraSdkAddress": "0x2E82a7dc2Cd5B392AFD5A415E21Fd7AeC3F032c1", + "auroraUtilsAddress": "0x609DcD21382c33Be97bbC031b11D15b0f9413641", + "auroraCodecAddress": "0xfaBF4429d83b0045260b2a3cb856EAF690cF7Bd3", + "wNearAddress": "0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d", + "siloToSiloProxyAddress": "0xAB73F7deb72dD71954F7EF48eb116f6e96EcCAf2" +} \ No newline at end of file diff --git a/silo-to-silo/configs/enpower-silo-testnet.json b/silo-to-silo/configs/enpower-silo-testnet.json deleted file mode 100644 index 2a1ba022..00000000 --- a/silo-to-silo/configs/enpower-silo-testnet.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "siloAccountId": "silo-1.aurora-silo-dev.near", - "auroraSdkAddress": "", - "auroraUtilsAddress": "", - "wNearAddress": "" -} \ No newline at end of file diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index 046e46ef..47bf1793 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -226,8 +226,8 @@ module.exports = { url: "https://develop.rpc.testnet.aurora.dev:8545", accounts: [`0x${AURORA_PRIVATE_KEY}`], }, - enpower_silo_aurora: { - url: "https://enpower.aurora.dev", + mainnet_enpower: { + url: "http://powergold.aurora.dev", accounts: [`0x${AURORA_PRIVATE_KEY}`], }, }, @@ -239,7 +239,7 @@ module.exports = { customChains: [ { network: "mainnet_aurora", - chainId: 1313161554, + chainId: 1313161560, urls: { apiURL: "https://explorer.mainnet.aurora.dev/api", browserURL: "https://explorer.mainnet.aurora.dev", @@ -253,6 +253,14 @@ module.exports = { browserURL: "https://explorer.testnet.aurora.dev", }, }, + { + network: "mainnet_enpower", + chainId: 1313161555, + urls: { + apiURL: "https://explorer.powergold.aurora.dev/api", + browserURL: "https://explorer.powergold.aurora.dev", + }, + }, ], }, mocha: { From 49aaa09182cef4a459e2a473aeb70e95528e0577 Mon Sep 17 00:00:00 2001 From: karim-en Date: Thu, 21 Dec 2023 16:16:54 +0000 Subject: [PATCH 46/50] Fix chainId --- silo-to-silo/hardhat.config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index 47bf1793..961a92ca 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -229,17 +229,19 @@ module.exports = { mainnet_enpower: { url: "http://powergold.aurora.dev", accounts: [`0x${AURORA_PRIVATE_KEY}`], + chainId: 1313161560, }, }, etherscan: { apiKey: { mainnet_aurora: `${ETHERSCAN_API_KEY}`, testnet_aurora: `${ETHERSCAN_API_KEY}`, + mainnet_enpower: `${ETHERSCAN_API_KEY}`, }, customChains: [ { network: "mainnet_aurora", - chainId: 1313161560, + chainId: 1313161554, urls: { apiURL: "https://explorer.mainnet.aurora.dev/api", browserURL: "https://explorer.mainnet.aurora.dev", @@ -255,7 +257,7 @@ module.exports = { }, { network: "mainnet_enpower", - chainId: 1313161555, + chainId: 1313161560, urls: { apiURL: "https://explorer.powergold.aurora.dev/api", browserURL: "https://explorer.powergold.aurora.dev", From ab1c4368ea34c86f07ffc84abcd2d1203673324d Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 12 Jan 2024 16:12:35 +0000 Subject: [PATCH 47/50] Panic if the transfer failed --- silo-to-silo/contracts/src/SiloToSilo.sol | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 32e4c88b..5819747b 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -259,11 +259,8 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 amount, string calldata receiverId ) external onlyRole(CALLBACK_ROLE) { - uint128 transferredAmount = 0; - if (AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful) { - transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); - } - + require(AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, "ft_transfer_call failed"); + uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); uint128 refundAmount = amount - transferredAmount; if (refundAmount > 0) { balance[token][sender] += refundAmount; From 1cce40aa88e773f3b7e7ac4f4a333f13f15a4cfb Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 12 Jan 2024 16:45:47 +0000 Subject: [PATCH 48/50] Upgrade on enpower silo --- .../.openzeppelin/unknown-1313161560.json | 270 ++++++++++++++++++ silo-to-silo/contracts/src/SiloToSilo.sol | 4 +- silo-to-silo/hardhat.config.js | 1 - 3 files changed, 272 insertions(+), 3 deletions(-) diff --git a/silo-to-silo/.openzeppelin/unknown-1313161560.json b/silo-to-silo/.openzeppelin/unknown-1313161560.json index 0c69096c..12271d0b 100644 --- a/silo-to-silo/.openzeppelin/unknown-1313161560.json +++ b/silo-to-silo/.openzeppelin/unknown-1313161560.json @@ -277,6 +277,276 @@ } } } + }, + "2c5d12709cbbde83b698727cac90980b20981895edd5b93e412c25552f4af0bb": { + "address": "0xc4e0426457190B89B0cf40843bc0Ea3AB8341c74", + "txHash": "0x14f231ca251dfebf104a01b47064e647660e9965176e6795030f82ce1949c8e1", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_paused", + "offset": 0, + "slot": "251", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "near", + "offset": 0, + "slot": "301", + "type": "t_struct(NEAR)29_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:36" + }, + { + "label": "siloAccountId", + "offset": 0, + "slot": "302", + "type": "t_string_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:37" + }, + { + "label": "ftTransferCallCounter", + "offset": 0, + "slot": "303", + "type": "t_uint256", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:38" + }, + { + "label": "registeredTokens", + "offset": 0, + "slot": "304", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:41" + }, + { + "label": "balance", + "offset": 0, + "slot": "305", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:44" + }, + { + "label": "registeredRecipients", + "offset": 0, + "slot": "306", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:47" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20)5413": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IEvmErc20)6720": { + "label": "contract IEvmErc20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint128)": { + "label": "mapping(address => uint128)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))": { + "label": "mapping(contract IEvmErc20 => mapping(address => uint128))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))": { + "label": "mapping(contract IEvmErc20 => mapping(string => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)": { + "label": "mapping(contract IEvmErc20 => struct TokenInfo)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_bool)": { + "label": "mapping(string => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(NEAR)29_storage": { + "label": "struct NEAR", + "members": [ + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "wNEAR", + "type": "t_contract(IERC20)5413", + "offset": 1, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(RoleData)1839_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(TokenInfo)6744_storage": { + "label": "struct TokenInfo", + "members": [ + { + "label": "nearTokenAccountId", + "type": "t_string_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "isStorageRegistered", + "type": "t_bool", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index 5819747b..d0bb7438 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.17; -import {IERC20 as IERC20_NEAR} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {AuroraSdk, NEAR, PromiseCreateArgs, PromiseResultStatus, PromiseWithCallback} from "@auroraisnear/aurora-sdk/aurora-sdk/AuroraSdk.sol"; import "@auroraisnear/aurora-sdk/aurora-sdk/Utils.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; @@ -71,7 +71,7 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, string memory _siloAccountId, string memory _nativeTokenAccountId ) external initializer { - near = AuroraSdk.initNear(IERC20_NEAR(wnearAddress)); + near = AuroraSdk.initNear(IERC20(wnearAddress)); siloAccountId = _siloAccountId; registeredTokens[IEvmErc20(address(0))].nearTokenAccountId = _nativeTokenAccountId; diff --git a/silo-to-silo/hardhat.config.js b/silo-to-silo/hardhat.config.js index 961a92ca..58fd0268 100644 --- a/silo-to-silo/hardhat.config.js +++ b/silo-to-silo/hardhat.config.js @@ -25,7 +25,6 @@ task("deploy", "Deploy silo to silo proxy contract") task("upgrade", "Upgrade silo to silo proxy contract") .addParam("silo", "Config file name without extension") - .addParam("proxy", "Current proxy address of the SiloToSilo contract") .setAction(async (taskArgs, hre) => { const { upgrade } = require("./utils/scripts.js"); const [signer] = await hre.ethers.getSigners(); From be85252b8b303490e37070a7b1534f1e0d2aa81d Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 12 Jan 2024 17:44:27 +0000 Subject: [PATCH 49/50] Re-upgrade contract on mainnet & enpower silo --- .../.openzeppelin/unknown-1313161554.json | 540 ++++++++++++++++++ .../.openzeppelin/unknown-1313161560.json | 274 +++++++++ silo-to-silo/contracts/src/SiloToSilo.sol | 5 +- 3 files changed, 818 insertions(+), 1 deletion(-) diff --git a/silo-to-silo/.openzeppelin/unknown-1313161554.json b/silo-to-silo/.openzeppelin/unknown-1313161554.json index d55ce748..30270b48 100644 --- a/silo-to-silo/.openzeppelin/unknown-1313161554.json +++ b/silo-to-silo/.openzeppelin/unknown-1313161554.json @@ -277,6 +277,546 @@ } } } + }, + "8a455580d0993872aca5fc4b84d21a87851015698327a35968c623753b994b07": { + "address": "0xC68EEAF180EFc261337d7969129575aBf8e22b79", + "txHash": "0x78741b149f5578b4fe7612533bacca9862d3f503266d56ba563bb88543fdd2a3", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_paused", + "offset": 0, + "slot": "251", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "near", + "offset": 0, + "slot": "301", + "type": "t_struct(NEAR)29_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:36" + }, + { + "label": "siloAccountId", + "offset": 0, + "slot": "302", + "type": "t_string_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:37" + }, + { + "label": "ftTransferCallCounter", + "offset": 0, + "slot": "303", + "type": "t_uint256", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:38" + }, + { + "label": "registeredTokens", + "offset": 0, + "slot": "304", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:41" + }, + { + "label": "balance", + "offset": 0, + "slot": "305", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:44" + }, + { + "label": "registeredRecipients", + "offset": 0, + "slot": "306", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:47" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20)5413": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IEvmErc20)6720": { + "label": "contract IEvmErc20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint128)": { + "label": "mapping(address => uint128)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))": { + "label": "mapping(contract IEvmErc20 => mapping(address => uint128))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))": { + "label": "mapping(contract IEvmErc20 => mapping(string => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)": { + "label": "mapping(contract IEvmErc20 => struct TokenInfo)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_bool)": { + "label": "mapping(string => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(NEAR)29_storage": { + "label": "struct NEAR", + "members": [ + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "wNEAR", + "type": "t_contract(IERC20)5413", + "offset": 1, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(RoleData)1839_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(TokenInfo)6744_storage": { + "label": "struct TokenInfo", + "members": [ + { + "label": "nearTokenAccountId", + "type": "t_string_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "isStorageRegistered", + "type": "t_bool", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "3bf3de3a84f6ec5dd3944a62250f9c9fd457dfff6392927cec511f7e83a34d99": { + "address": "0x2DEdeC314C82555E17c499BEAB03999649Fd2822", + "txHash": "0xa2214afd5cdf8517a4e3dacb10e58e49caf35bd93b010bb760bd3904f14264d6", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_paused", + "offset": 0, + "slot": "251", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "near", + "offset": 0, + "slot": "301", + "type": "t_struct(NEAR)29_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:36" + }, + { + "label": "siloAccountId", + "offset": 0, + "slot": "302", + "type": "t_string_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:37" + }, + { + "label": "ftTransferCallCounter", + "offset": 0, + "slot": "303", + "type": "t_uint256", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:38" + }, + { + "label": "registeredTokens", + "offset": 0, + "slot": "304", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:41" + }, + { + "label": "balance", + "offset": 0, + "slot": "305", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:44" + }, + { + "label": "registeredRecipients", + "offset": 0, + "slot": "306", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:47" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20)5413": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IEvmErc20)6720": { + "label": "contract IEvmErc20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint128)": { + "label": "mapping(address => uint128)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))": { + "label": "mapping(contract IEvmErc20 => mapping(address => uint128))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))": { + "label": "mapping(contract IEvmErc20 => mapping(string => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)": { + "label": "mapping(contract IEvmErc20 => struct TokenInfo)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_bool)": { + "label": "mapping(string => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(NEAR)29_storage": { + "label": "struct NEAR", + "members": [ + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "wNEAR", + "type": "t_contract(IERC20)5413", + "offset": 1, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(RoleData)1839_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(TokenInfo)6744_storage": { + "label": "struct TokenInfo", + "members": [ + { + "label": "nearTokenAccountId", + "type": "t_string_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "isStorageRegistered", + "type": "t_bool", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/silo-to-silo/.openzeppelin/unknown-1313161560.json b/silo-to-silo/.openzeppelin/unknown-1313161560.json index 12271d0b..78147017 100644 --- a/silo-to-silo/.openzeppelin/unknown-1313161560.json +++ b/silo-to-silo/.openzeppelin/unknown-1313161560.json @@ -546,6 +546,280 @@ "numberOfBytes": "1" } } + }, + "allAddresses": [ + "0xc4e0426457190B89B0cf40843bc0Ea3AB8341c74", + "0x4C7834936874C125fe4cE9C16C021D9EB8efBB6e" + ] + }, + "f37521111438b4afeed64c54f427d299f53f1e2df141dea9812290eee14d32a0": { + "address": "0x33CFF0f153725f38eBBD634117d6E4f582eAf6E0", + "txHash": "0xc6805756aacf7f0a4c170b33ab32102ec716c63ff3414bfc4901bc5f54e26bf8", + "layout": { + "solcVersion": "0.8.21", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:62" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_paused", + "offset": 0, + "slot": "251", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "near", + "offset": 0, + "slot": "301", + "type": "t_struct(NEAR)29_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:36" + }, + { + "label": "siloAccountId", + "offset": 0, + "slot": "302", + "type": "t_string_storage", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:37" + }, + { + "label": "ftTransferCallCounter", + "offset": 0, + "slot": "303", + "type": "t_uint256", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:38" + }, + { + "label": "registeredTokens", + "offset": 0, + "slot": "304", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:41" + }, + { + "label": "balance", + "offset": 0, + "slot": "305", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:44" + }, + { + "label": "registeredRecipients", + "offset": 0, + "slot": "306", + "type": "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))", + "contract": "SiloToSilo", + "src": "contracts/src/SiloToSilo.sol:47" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20)5413": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IEvmErc20)6720": { + "label": "contract IEvmErc20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint128)": { + "label": "mapping(address => uint128)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)1839_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_address,t_uint128))": { + "label": "mapping(contract IEvmErc20 => mapping(address => uint128))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_mapping(t_string_memory_ptr,t_bool))": { + "label": "mapping(contract IEvmErc20 => mapping(string => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_contract(IEvmErc20)6720,t_struct(TokenInfo)6744_storage)": { + "label": "mapping(contract IEvmErc20 => struct TokenInfo)", + "numberOfBytes": "32" + }, + "t_mapping(t_string_memory_ptr,t_bool)": { + "label": "mapping(string => bool)", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(NEAR)29_storage": { + "label": "struct NEAR", + "members": [ + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "0" + }, + { + "label": "wNEAR", + "type": "t_contract(IERC20)5413", + "offset": 1, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(RoleData)1839_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(TokenInfo)6744_storage": { + "label": "struct TokenInfo", + "members": [ + { + "label": "nearTokenAccountId", + "type": "t_string_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "isStorageRegistered", + "type": "t_bool", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint128": { + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } } } } diff --git a/silo-to-silo/contracts/src/SiloToSilo.sol b/silo-to-silo/contracts/src/SiloToSilo.sol index d0bb7438..45242f35 100644 --- a/silo-to-silo/contracts/src/SiloToSilo.sol +++ b/silo-to-silo/contracts/src/SiloToSilo.sol @@ -259,7 +259,10 @@ contract SiloToSilo is Initializable, UUPSUpgradeable, AccessControlUpgradeable, uint128 amount, string calldata receiverId ) external onlyRole(CALLBACK_ROLE) { - require(AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, "ft_transfer_call failed"); + require( + AuroraSdk.promiseResult(0).status == PromiseResultStatus.Successful, + "ERROR: ft_transfer_call() XCC call failed" + ); uint128 transferredAmount = _stringToUint(AuroraSdk.promiseResult(0).output); uint128 refundAmount = amount - transferredAmount; if (refundAmount > 0) { From aee049aeb130782f1f23470fba035192530dd7c2 Mon Sep 17 00:00:00 2001 From: karim-en Date: Fri, 12 Jan 2024 18:49:43 +0000 Subject: [PATCH 50/50] Fix withdraw test --- silo-to-silo/integration-tests/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/silo-to-silo/integration-tests/src/lib.rs b/silo-to-silo/integration-tests/src/lib.rs index b96667d7..b3ca883d 100644 --- a/silo-to-silo/integration-tests/src/lib.rs +++ b/silo-to-silo/integration-tests/src/lib.rs @@ -389,7 +389,7 @@ mod tests { let balance_silo = infra.get_mock_token_balance_silo().await; assert_eq!(balance_silo.as_u64(), 0); - infra.check_user_balance_engine(100).await; + infra.check_user_balance_engine(0).await; withdraw( &infra.engine_silo_to_silo_contract, infra.engine_mock_token.address.raw(), @@ -399,7 +399,7 @@ mod tests { .await; let balance_engine_after_withdraw = infra.get_mock_token_balance_engine().await; - assert_eq!(balance_engine_before, balance_engine_after_withdraw); + assert_eq!(balance_engine_after_withdraw, 0.into()); infra.check_user_balance_engine(0).await; }