diff --git a/.yarn/cache/@synthetixio-router-npm-3.3.7-fd9738c2d3-f79d119b24.zip b/.yarn/cache/@synthetixio-router-npm-3.3.7-fd9738c2d3-f79d119b24.zip deleted file mode 100644 index b85fcbc7f2..0000000000 Binary files a/.yarn/cache/@synthetixio-router-npm-3.3.7-fd9738c2d3-f79d119b24.zip and /dev/null differ diff --git a/.yarn/cache/@synthetixio-router-npm-3.4.0-d7509c77e4-da0db66e85.zip b/.yarn/cache/@synthetixio-router-npm-3.4.0-d7509c77e4-da0db66e85.zip new file mode 100644 index 0000000000..ffe20b2a04 Binary files /dev/null and b/.yarn/cache/@synthetixio-router-npm-3.4.0-d7509c77e4-da0db66e85.zip differ diff --git a/.yarn/cache/@usecannon-builder-npm-2.13.6-3a1c3b690c-6fdff249d7.zip b/.yarn/cache/@usecannon-builder-npm-2.15.2-1c8a995821-86716e885f.zip similarity index 62% rename from .yarn/cache/@usecannon-builder-npm-2.13.6-3a1c3b690c-6fdff249d7.zip rename to .yarn/cache/@usecannon-builder-npm-2.15.2-1c8a995821-86716e885f.zip index 825f32e221..c0eea34177 100644 Binary files a/.yarn/cache/@usecannon-builder-npm-2.13.6-3a1c3b690c-6fdff249d7.zip and b/.yarn/cache/@usecannon-builder-npm-2.15.2-1c8a995821-86716e885f.zip differ diff --git a/.yarn/cache/@usecannon-cli-npm-2.13.6-52e2f36490-b644c24db8.zip b/.yarn/cache/@usecannon-cli-npm-2.13.6-52e2f36490-b644c24db8.zip deleted file mode 100644 index 833d966db5..0000000000 Binary files a/.yarn/cache/@usecannon-cli-npm-2.13.6-52e2f36490-b644c24db8.zip and /dev/null differ diff --git a/.yarn/cache/@usecannon-cli-npm-2.15.2-65ee56c90b-da2730754f.zip b/.yarn/cache/@usecannon-cli-npm-2.15.2-65ee56c90b-da2730754f.zip new file mode 100644 index 0000000000..2c8bf4dc1c Binary files /dev/null and b/.yarn/cache/@usecannon-cli-npm-2.15.2-65ee56c90b-da2730754f.zip differ diff --git a/.yarn/cache/abitype-npm-1.0.2-4e093b7057-d80d10521e.zip b/.yarn/cache/abitype-npm-1.0.2-4e093b7057-d80d10521e.zip new file mode 100644 index 0000000000..301035dd74 Binary files /dev/null and b/.yarn/cache/abitype-npm-1.0.2-4e093b7057-d80d10521e.zip differ diff --git a/.yarn/cache/axios-npm-1.6.7-d7b9974d1b-a1932b089e.zip b/.yarn/cache/axios-npm-1.6.7-d7b9974d1b-a1932b089e.zip deleted file mode 100644 index 7a122000c0..0000000000 Binary files a/.yarn/cache/axios-npm-1.6.7-d7b9974d1b-a1932b089e.zip and /dev/null differ diff --git a/.yarn/cache/axios-npm-1.7.2-c89264f6f7-6ae80dda97.zip b/.yarn/cache/axios-npm-1.7.2-c89264f6f7-6ae80dda97.zip new file mode 100644 index 0000000000..ee5abb7f41 Binary files /dev/null and b/.yarn/cache/axios-npm-1.7.2-c89264f6f7-6ae80dda97.zip differ diff --git a/.yarn/cache/axios-retry-npm-4.0.0-4e8652b2f1-40c7283754.zip b/.yarn/cache/axios-retry-npm-4.0.0-4e8652b2f1-40c7283754.zip deleted file mode 100644 index 26382dca4a..0000000000 Binary files a/.yarn/cache/axios-retry-npm-4.0.0-4e8652b2f1-40c7283754.zip and /dev/null differ diff --git a/.yarn/cache/axios-retry-npm-4.4.0-3e6a76d203-b1c60803ef.zip b/.yarn/cache/axios-retry-npm-4.4.0-3e6a76d203-b1c60803ef.zip new file mode 100644 index 0000000000..728031e13d Binary files /dev/null and b/.yarn/cache/axios-retry-npm-4.4.0-3e6a76d203-b1c60803ef.zip differ diff --git a/.yarn/cache/fastq-npm-1.15.0-1013f6514e-67c01b1c97.zip b/.yarn/cache/fastq-npm-1.15.0-1013f6514e-67c01b1c97.zip deleted file mode 100644 index b1bff8f0c2..0000000000 Binary files a/.yarn/cache/fastq-npm-1.15.0-1013f6514e-67c01b1c97.zip and /dev/null differ diff --git a/.yarn/cache/fastq-npm-1.17.1-56d4554993-a443180068.zip b/.yarn/cache/fastq-npm-1.17.1-56d4554993-a443180068.zip new file mode 100644 index 0000000000..155a545ec3 Binary files /dev/null and b/.yarn/cache/fastq-npm-1.17.1-56d4554993-a443180068.zip differ diff --git a/.yarn/cache/follow-redirects-npm-1.15.5-9d14db76ca-d467f13c1c.zip b/.yarn/cache/follow-redirects-npm-1.15.6-50635fe51d-70c7612c4c.zip similarity index 61% rename from .yarn/cache/follow-redirects-npm-1.15.5-9d14db76ca-d467f13c1c.zip rename to .yarn/cache/follow-redirects-npm-1.15.6-50635fe51d-70c7612c4c.zip index 289b766fbb..d64f38e50a 100644 Binary files a/.yarn/cache/follow-redirects-npm-1.15.5-9d14db76ca-d467f13c1c.zip and b/.yarn/cache/follow-redirects-npm-1.15.6-50635fe51d-70c7612c4c.zip differ diff --git a/.yarn/cache/fs-extra-npm-10.1.0-86573680ed-05ce2c3b59.zip b/.yarn/cache/fs-extra-npm-10.1.0-86573680ed-05ce2c3b59.zip deleted file mode 100644 index f4c72281a3..0000000000 Binary files a/.yarn/cache/fs-extra-npm-10.1.0-86573680ed-05ce2c3b59.zip and /dev/null differ diff --git a/.yarn/cache/hardhat-cannon-npm-2.13.6-2321a8e35b-b671b0ad16.zip b/.yarn/cache/hardhat-cannon-npm-2.15.2-89689ac509-c52d4dd971.zip similarity index 66% rename from .yarn/cache/hardhat-cannon-npm-2.13.6-2321a8e35b-b671b0ad16.zip rename to .yarn/cache/hardhat-cannon-npm-2.15.2-89689ac509-c52d4dd971.zip index a790010aa5..d81d6315c2 100644 Binary files a/.yarn/cache/hardhat-cannon-npm-2.13.6-2321a8e35b-b671b0ad16.zip and b/.yarn/cache/hardhat-cannon-npm-2.15.2-89689ac509-c52d4dd971.zip differ diff --git a/.yarn/cache/isows-npm-1.0.3-aa8c925c69-9cacd5cf59.zip b/.yarn/cache/isows-npm-1.0.4-84b48fd8ef-a3ee62e3d6.zip similarity index 64% rename from .yarn/cache/isows-npm-1.0.3-aa8c925c69-9cacd5cf59.zip rename to .yarn/cache/isows-npm-1.0.4-84b48fd8ef-a3ee62e3d6.zip index a94b5da9b2..d985d911d9 100644 Binary files a/.yarn/cache/isows-npm-1.0.3-aa8c925c69-9cacd5cf59.zip and b/.yarn/cache/isows-npm-1.0.4-84b48fd8ef-a3ee62e3d6.zip differ diff --git a/.yarn/cache/table-npm-6.8.1-83abb79e20-512c4f2bfb.zip b/.yarn/cache/table-npm-6.8.2-e33ecc3c54-2946162eb8.zip similarity index 79% rename from .yarn/cache/table-npm-6.8.1-83abb79e20-512c4f2bfb.zip rename to .yarn/cache/table-npm-6.8.2-e33ecc3c54-2946162eb8.zip index 0dfea35970..82d57d0d69 100644 Binary files a/.yarn/cache/table-npm-6.8.1-83abb79e20-512c4f2bfb.zip and b/.yarn/cache/table-npm-6.8.2-e33ecc3c54-2946162eb8.zip differ diff --git a/.yarn/cache/tildify-npm-2.0.0-324bfdd523-0f5fee9362.zip b/.yarn/cache/tildify-npm-2.0.0-324bfdd523-0f5fee9362.zip deleted file mode 100644 index 1a9733efaa..0000000000 Binary files a/.yarn/cache/tildify-npm-2.0.0-324bfdd523-0f5fee9362.zip and /dev/null differ diff --git a/.yarn/cache/tildify-npm-3.0.0-8d40ea2880-4d55c391f8.zip b/.yarn/cache/tildify-npm-3.0.0-8d40ea2880-4d55c391f8.zip new file mode 100644 index 0000000000..b6f3100048 Binary files /dev/null and b/.yarn/cache/tildify-npm-3.0.0-8d40ea2880-4d55c391f8.zip differ diff --git a/.yarn/cache/typedoc-plugin-markdown-npm-3.17.1-091f1bd18a-21bfe7fba6.zip b/.yarn/cache/typedoc-plugin-markdown-npm-3.17.1-091f1bd18a-21bfe7fba6.zip deleted file mode 100644 index fb702ab15d..0000000000 Binary files a/.yarn/cache/typedoc-plugin-markdown-npm-3.17.1-091f1bd18a-21bfe7fba6.zip and /dev/null differ diff --git a/.yarn/cache/viem-npm-2.9.27-886876d71c-e4a1a16226.zip b/.yarn/cache/viem-npm-2.14.0-d5c1129d7a-04132cf4bc.zip similarity index 63% rename from .yarn/cache/viem-npm-2.9.27-886876d71c-e4a1a16226.zip rename to .yarn/cache/viem-npm-2.14.0-d5c1129d7a-04132cf4bc.zip index 3256cc8db9..6af7a2fb9a 100644 Binary files a/.yarn/cache/viem-npm-2.9.27-886876d71c-e4a1a16226.zip and b/.yarn/cache/viem-npm-2.14.0-d5c1129d7a-04132cf4bc.zip differ diff --git a/.yarn/cache/zod-npm-3.22.4-2bccbc41b4-73622ca36a.zip b/.yarn/cache/zod-npm-3.22.4-2bccbc41b4-73622ca36a.zip deleted file mode 100644 index 285282146a..0000000000 Binary files a/.yarn/cache/zod-npm-3.22.4-2bccbc41b4-73622ca36a.zip and /dev/null differ diff --git a/.yarn/cache/zod-npm-3.23.8-11c49c85b5-846fd73e1a.zip b/.yarn/cache/zod-npm-3.23.8-11c49c85b5-846fd73e1a.zip new file mode 100644 index 0000000000..a56c32125e Binary files /dev/null and b/.yarn/cache/zod-npm-3.23.8-11c49c85b5-846fd73e1a.zip differ diff --git a/auxiliary/ERC4626ToAssetsRatioOracle/package.json b/auxiliary/ERC4626ToAssetsRatioOracle/package.json index f8753289e5..8acd857e34 100644 --- a/auxiliary/ERC4626ToAssetsRatioOracle/package.json +++ b/auxiliary/ERC4626ToAssetsRatioOracle/package.json @@ -29,7 +29,7 @@ "@synthetixio/docgen": "workspace:*", "@synthetixio/main": "workspace:*", "@synthetixio/wei": "^2.74.4", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "hardhat": "^2.19.5", "solidity-docgen": "^0.6.0-beta.36" diff --git a/auxiliary/RewardsDistributor/package.json b/auxiliary/RewardsDistributor/package.json index 449eff452e..7f26446971 100644 --- a/auxiliary/RewardsDistributor/package.json +++ b/auxiliary/RewardsDistributor/package.json @@ -21,7 +21,7 @@ "forge-coverage": "forge coverage --report lcov" }, "devDependencies": { - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "forge-std": "github:foundry-rs/forge-std#master" }, "depcheck": { diff --git a/auxiliary/RewardsDistributorExternal/package.json b/auxiliary/RewardsDistributorExternal/package.json index 7399f8894a..953bc2ab5f 100644 --- a/auxiliary/RewardsDistributorExternal/package.json +++ b/auxiliary/RewardsDistributorExternal/package.json @@ -21,7 +21,7 @@ "forge-coverage": "forge coverage --report lcov" }, "devDependencies": { - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "forge-std": "github:foundry-rs/forge-std#master" }, "depcheck": { diff --git a/auxiliary/WstEthToStEthRatioOracle/package.json b/auxiliary/WstEthToStEthRatioOracle/package.json index 58432658de..696577dfb9 100644 --- a/auxiliary/WstEthToStEthRatioOracle/package.json +++ b/auxiliary/WstEthToStEthRatioOracle/package.json @@ -29,7 +29,7 @@ "@synthetixio/docgen": "workspace:*", "@synthetixio/main": "workspace:*", "@synthetixio/wei": "^2.74.4", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "hardhat": "^2.19.5", "solidity-docgen": "^0.6.0-beta.36" diff --git a/markets/bfp-market/cannonfile.test.toml b/markets/bfp-market/cannonfile.test.toml index 1cf80c75a9..ab276806c2 100644 --- a/markets/bfp-market/cannonfile.test.toml +++ b/markets/bfp-market/cannonfile.test.toml @@ -68,6 +68,10 @@ args = [] artifact = "contracts/modules/SettlementHookModule.sol:SettlementHookModule" args = [] +[contract.SplitAccountConfigurationModule] +artifact = "contracts/modules/SplitAccountConfigurationModule.sol:SplitAccountConfigurationModule" +args = [] + # --- Distributor contract --- # [contract.PerpRewardDistributor] @@ -104,6 +108,7 @@ contracts = [ "LiquidationModule", "PerpRewardDistributorFactoryModule", "SettlementHookModule", + "SplitAccountConfigurationModule", "__TestHelperModule", ] diff --git a/markets/bfp-market/cannonfile.toml b/markets/bfp-market/cannonfile.toml index 88dd397e62..e2e2385fc1 100644 --- a/markets/bfp-market/cannonfile.toml +++ b/markets/bfp-market/cannonfile.toml @@ -64,6 +64,10 @@ args = [] artifact = "contracts/modules/SettlementHookModule.sol:SettlementHookModule" args = [] +[contract.SplitAccountConfigurationModule] +artifact = "contracts/modules/SplitAccountConfigurationModule.sol:SplitAccountConfigurationModule" +args = [] + # --- Distributor contract --- # [contract.PerpRewardDistributor] @@ -94,6 +98,7 @@ contracts = [ "LiquidationModule", "PerpRewardDistributorFactoryModule", "SettlementHookModule", + "SplitAccountConfigurationModule", ] # --- Proxy post deployment --- # diff --git a/markets/bfp-market/contracts/interfaces/ISplitAccountConfigurationModule.sol b/markets/bfp-market/contracts/interfaces/ISplitAccountConfigurationModule.sol new file mode 100644 index 0000000000..c2f7a4fada --- /dev/null +++ b/markets/bfp-market/contracts/interfaces/ISplitAccountConfigurationModule.sol @@ -0,0 +1,30 @@ +//SPDX-License-Identifier: MIT +pragma solidity >=0.8.11 <0.9.0; + +import {SettlementHookConfiguration} from "../storage/SettlementHookConfiguration.sol"; + +interface ISplitAccountConfigurationModule { + // --- Events --- // + + /// @notice Emitted when split account whitelist is configured. + /// @param from Address of configurer + /// @param hooks Number of addresses configured + event SplitAccountConfigured(address indexed from, uint256 hooks); + + // --- Mutations --- // + + /// @notice Configures a list of addresses to be whitelisted for splitAccount. + /// @param addresses An array of addresses to whitelist + function setEndorsedSplitAccounts(address[] memory addresses) external; + + // --- Views --- // + + /// @notice Returns addresses allowed to split account. + /// @return addresses list of addresses + function getEndorsedSplitAccounts() external view returns (address[] memory addresses); + + /// @notice Returns whether the specified hook is whitelisted. + /// @param addr Address of hook to assert + /// @return isEndoresedForSplitAccount True if whitelisted, false otherwise + function isEndorsedForSplitAccount(address addr) external view returns (bool); +} diff --git a/markets/bfp-market/contracts/modules/PerpAccountModule.sol b/markets/bfp-market/contracts/modules/PerpAccountModule.sol index 721da7431b..e81a0d4fe9 100644 --- a/markets/bfp-market/contracts/modules/PerpAccountModule.sol +++ b/markets/bfp-market/contracts/modules/PerpAccountModule.sol @@ -17,6 +17,7 @@ import {Margin} from "../storage/Margin.sol"; import {AddressRegistry} from "../storage/AddressRegistry.sol"; import {PerpMarketConfiguration} from "../storage/PerpMarketConfiguration.sol"; import {SettlementHookConfiguration} from "../storage/SettlementHookConfiguration.sol"; +import {SplitAccountConfiguration} from "../storage/SplitAccountConfiguration.sol"; /* solhint-disable meta-transactions/no-msg-sender */ @@ -229,6 +230,9 @@ contract PerpAccountModule is IPerpAccountModule { Position.Data storage toPosition = market.positions[toId]; Position.Data storage fromPosition = market.positions[fromId]; + if (SplitAccountConfiguration.load().whitelisted[msg.sender] != true) { + revert ErrorUtil.Unauthorized(msg.sender); + } // Cannot split more than what's available. if (proportion > DecimalMath.UNIT) { revert ErrorUtil.AccountSplitProportionTooLarge(); diff --git a/markets/bfp-market/contracts/modules/SplitAccountConfigurationModule.sol b/markets/bfp-market/contracts/modules/SplitAccountConfigurationModule.sol new file mode 100644 index 0000000000..9dda9e8c63 --- /dev/null +++ b/markets/bfp-market/contracts/modules/SplitAccountConfigurationModule.sol @@ -0,0 +1,66 @@ +//SPDX-License-Identifier: MIT +pragma solidity >=0.8.11 <0.9.0; + +import {IERC165} from "@synthetixio/core-contracts/contracts/interfaces/IERC165.sol"; +import {OwnableStorage} from "@synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol"; +import {ERC165Helper} from "@synthetixio/core-contracts/contracts/utils/ERC165Helper.sol"; +import {ERC2771Context} from "@synthetixio/core-contracts/contracts/utils/ERC2771Context.sol"; +import {ISplitAccountConfigurationModule} from "../interfaces/ISplitAccountConfigurationModule.sol"; +import {SplitAccountConfiguration} from "../storage/SplitAccountConfiguration.sol"; +import {ErrorUtil} from "../utils/ErrorUtil.sol"; + +contract SplitAccountConfigurationModule is ISplitAccountConfigurationModule { + // --- Mutations --- // + + /** + * @inheritdoc ISplitAccountConfigurationModule + */ + function setEndorsedSplitAccounts(address[] memory addresses) external { + OwnableStorage.onlyOwner(); + + SplitAccountConfiguration.GlobalData storage config = SplitAccountConfiguration.load(); + uint256 existingAddresses = config.whitelistedAddresses.length; + for (uint256 i = 0; i < existingAddresses; ) { + delete config.whitelisted[config.whitelistedAddresses[i]]; + unchecked { + ++i; + } + } + delete config.whitelistedAddresses; + + uint256 addressesLength = addresses.length; + address currentAddress; + for (uint256 i = 0; i < addressesLength; ) { + currentAddress = addresses[i]; + if (currentAddress == address(0)) { + revert ErrorUtil.ZeroAddress(); + } + + config.whitelisted[currentAddress] = true; + unchecked { + ++i; + } + } + config.whitelistedAddresses = addresses; + + emit SplitAccountConfigured(ERC2771Context._msgSender(), addressesLength); + } + + // --- Views --- // + + /** + * @inheritdoc ISplitAccountConfigurationModule + */ + function getEndorsedSplitAccounts() external view returns (address[] memory addresses) { + SplitAccountConfiguration.GlobalData storage config = SplitAccountConfiguration.load(); + return config.whitelistedAddresses; + } + + /** + * @inheritdoc ISplitAccountConfigurationModule + */ + function isEndorsedForSplitAccount(address addr) external view returns (bool) { + SplitAccountConfiguration.GlobalData storage config = SplitAccountConfiguration.load(); + return config.whitelisted[addr]; + } +} diff --git a/markets/bfp-market/contracts/storage/Position.sol b/markets/bfp-market/contracts/storage/Position.sol index 60e29d408c..36f5d07a1a 100644 --- a/markets/bfp-market/contracts/storage/Position.sol +++ b/markets/bfp-market/contracts/storage/Position.sol @@ -141,7 +141,10 @@ library Position { uint256 minimumCredit = market.getMinimumCredit(marketConfig, oraclePrice, addresses); int256 delegatedCollateralValueUsd = market.getDelegatedCollateralValueUsd(addresses); - if (delegatedCollateralValueUsd < minimumCredit.toInt()) { + if ( + delegatedCollateralValueUsd + market.depositedCollateral[addresses.sUsd].toInt() < + minimumCredit.toInt() + ) { revert ErrorUtil.InsufficientLiquidity(); } } diff --git a/markets/bfp-market/contracts/storage/SplitAccountConfiguration.sol b/markets/bfp-market/contracts/storage/SplitAccountConfiguration.sol new file mode 100644 index 0000000000..489dc3f5d6 --- /dev/null +++ b/markets/bfp-market/contracts/storage/SplitAccountConfiguration.sol @@ -0,0 +1,25 @@ +//SPDX-License-Identifier: MIT +pragma solidity >=0.8.11 <0.9.0; + +library SplitAccountConfiguration { + // --- Constants --- // + + bytes32 private constant GLOBAL_DATA_SLOT_NAME = + keccak256(abi.encode("io.synthetix.bfp-market.SplitAccountConfiguration")); + + // --- Storage --- // + + struct GlobalData { + /// {address => isEnabled}. + mapping(address => bool) whitelisted; + /// Array of whitelisted addresses (use whitelisted mapping). + address[] whitelistedAddresses; + } + + function load() internal pure returns (SplitAccountConfiguration.GlobalData storage d) { + bytes32 s = GLOBAL_DATA_SLOT_NAME; + assembly { + d.slot := s + } + } +} diff --git a/markets/bfp-market/contracts/utils/ErrorUtil.sol b/markets/bfp-market/contracts/utils/ErrorUtil.sol index 20dffaa74c..69e33750ab 100644 --- a/markets/bfp-market/contracts/utils/ErrorUtil.sol +++ b/markets/bfp-market/contracts/utils/ErrorUtil.sol @@ -101,6 +101,9 @@ library ErrorUtil { /// @notice Thrown when an invalid Core as passed was specified. error InvalidCoreAddress(address synthetixCore); + /// @notice Thrown when an account is not authorized to perform an action. + error Unauthorized(address caller); + /// @notice Thrown when a specified hook is not whitelisted, or does not match spec, or otherwise. error InvalidHook(address hook); diff --git a/markets/bfp-market/package.json b/markets/bfp-market/package.json index 44cbdc172b..7af6328ddf 100644 --- a/markets/bfp-market/package.json +++ b/markets/bfp-market/package.json @@ -32,7 +32,7 @@ "@synthetixio/wei": "^2.74.4", "@types/lodash": "^4.14.199", "@types/mocha-each": "2.0.1", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "hardhat": "^2.19.5", "lodash": "^4.17.21", diff --git a/markets/bfp-market/storage.dump.sol b/markets/bfp-market/storage.dump.sol index 692522659a..971904c710 100644 --- a/markets/bfp-market/storage.dump.sol +++ b/markets/bfp-market/storage.dump.sol @@ -950,6 +950,21 @@ library SettlementHookConfiguration { } } +// @custom:artifact contracts/storage/SplitAccountConfiguration.sol:SplitAccountConfiguration +library SplitAccountConfiguration { + bytes32 private constant GLOBAL_DATA_SLOT_NAME = keccak256(abi.encode("io.synthetix.bfp-market.SplitAccountConfiguration")); + struct GlobalData { + mapping(address => bool) whitelisted; + address[] whitelistedAddresses; + } + function load() internal pure returns (SplitAccountConfiguration.GlobalData storage d) { + bytes32 s = GLOBAL_DATA_SLOT_NAME; + assembly { + d.slot := s + } + } +} + // @custom:artifact contracts/utils/Flags.sol:Flags library Flags { bytes32 public constant CREATE_ACCOUNT = "createAccount"; diff --git a/markets/bfp-market/test/integration/modules/PerpAccountModule.splitAccount.test.ts b/markets/bfp-market/test/integration/modules/PerpAccountModule.splitAccount.test.ts index 40839941f5..2a347678b2 100644 --- a/markets/bfp-market/test/integration/modules/PerpAccountModule.splitAccount.test.ts +++ b/markets/bfp-market/test/integration/modules/PerpAccountModule.splitAccount.test.ts @@ -55,6 +55,36 @@ describe('PerpAccountModule splitAccount', () => { ); }); + it('should revert is caller is not whitelisted', async () => { + const { BfpMarketProxy } = systems(); + + const invalidAccountId = 42069; + const marketId = 1; + const fromTrader = genOneOf(traders()); + // Ensure we don't have any whitelisted accounts. + await withExplicitEvmMine(() => BfpMarketProxy.setEndorsedSplitAccounts([]), provider()); + + await assertRevert( + BfpMarketProxy.splitAccount(fromTrader.accountId, invalidAccountId, marketId, bn(0.1)), + `PermissionDenied`, + BfpMarketProxy + ); + }); + + it('should revert when fromAccount does not exist/has missing permission', async () => { + const { BfpMarketProxy } = systems(); + + const invalidAccountId = 42069; + const marketId = 1; + const toTrader = genOneOf(traders()); + + await assertRevert( + BfpMarketProxy.splitAccount(invalidAccountId, toTrader.accountId, marketId, bn(0.1)), + `PermissionDenied`, + BfpMarketProxy + ); + }); + it('should revert if proportion is bigger than 1', async () => { const { BfpMarketProxy } = systems(); @@ -63,6 +93,12 @@ describe('PerpAccountModule splitAccount', () => { const toTraderAccountId = 42069; await BfpMarketProxy.connect(fromTrader.signer)['createAccount(uint128)'](toTraderAccountId); const market = genOneOf(markets()); + + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); + await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( fromTrader.accountId, @@ -83,6 +119,12 @@ describe('PerpAccountModule splitAccount', () => { const toTraderAccountId = 42069; await BfpMarketProxy.connect(fromTrader.signer)['createAccount(uint128)'](toTraderAccountId); const market = genOneOf(markets()); + + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); + await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( fromTrader.accountId, @@ -103,6 +145,12 @@ describe('PerpAccountModule splitAccount', () => { const toTraderAccountId = 42069; await BfpMarketProxy.connect(fromTrader.signer)['createAccount(uint128)'](toTraderAccountId); const invalidMarketId = 69420; + + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); + await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( fromTrader.accountId, @@ -139,6 +187,11 @@ describe('PerpAccountModule splitAccount', () => { traderWithOrder, genOrder(bs, market, collateral, collateralDepositAmount) ); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); + await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( fromTrader.accountId, @@ -162,6 +215,10 @@ describe('PerpAccountModule splitAccount', () => { accountId: toTraderAccountId, }; await BfpMarketProxy.connect(toTrader.signer)['createAccount(uint128)'](toTraderAccountId); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( @@ -197,6 +254,10 @@ describe('PerpAccountModule splitAccount', () => { }; await BfpMarketProxy.connect(toTrader.signer)['createAccount(uint128)'](toTraderAccountId); await depositMargin(bs, genTrader(bs, { desiredTrader: toTrader, desiredMarket: market })); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( @@ -238,6 +299,10 @@ describe('PerpAccountModule splitAccount', () => { marketId, bn(1) ); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( @@ -272,6 +337,10 @@ describe('PerpAccountModule splitAccount', () => { toTrader, genOrder(bs, market, collateral, collateralDepositAmount) ); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( @@ -314,6 +383,11 @@ describe('PerpAccountModule splitAccount', () => { () => BfpMarketProxy.flagPosition(fromTrader.accountId, marketId), provider() ); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); + await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( fromTrader.accountId, @@ -352,6 +426,11 @@ describe('PerpAccountModule splitAccount', () => { .toBN() ); await tx.wait(); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); + await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( fromTrader.accountId, @@ -383,6 +462,11 @@ describe('PerpAccountModule splitAccount', () => { await commitAndSettle(bs, marketId, fromTrader, order); const proportion = bn(0.9999); + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); + await assertRevert( BfpMarketProxy.connect(fromTrader.signer).splitAccount( fromTrader.accountId, @@ -422,7 +506,10 @@ describe('PerpAccountModule splitAccount', () => { fromTrader.accountId, marketId ); - + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); const { receipt } = await withExplicitEvmMine( () => BfpMarketProxy.connect(fromTrader.signer).splitAccount( @@ -501,7 +588,10 @@ describe('PerpAccountModule splitAccount', () => { fromTrader.accountId, marketId ); - + await withExplicitEvmMine( + async () => BfpMarketProxy.setEndorsedSplitAccounts([await fromTrader.signer.getAddress()]), + provider() + ); const { receipt } = await withExplicitEvmMine( () => BfpMarketProxy.connect(fromTrader.signer).splitAccount( diff --git a/markets/bfp-market/test/integration/modules/SplitAccountConfigurationModule.test.ts b/markets/bfp-market/test/integration/modules/SplitAccountConfigurationModule.test.ts new file mode 100644 index 0000000000..e3f4ab2dd8 --- /dev/null +++ b/markets/bfp-market/test/integration/modules/SplitAccountConfigurationModule.test.ts @@ -0,0 +1,84 @@ +import assert from 'assert'; +import assertEvent from '@synthetixio/core-utils/utils/assertions/assert-event'; +import assertRevert from '@synthetixio/core-utils/utils/assertions/assert-revert'; +import { bootstrap } from '../../bootstrap'; +import { genAddress, genBootstrap, genNumber } from '../../generators'; +import { ADDRESS0, withExplicitEvmMine } from '../../helpers'; + +describe('SplitAccountConfigurationModule', () => { + const bs = bootstrap(genBootstrap()); + const { owner, traders, systems, provider, restore } = bs; + + beforeEach(restore); + + describe('setEndorsedSplitAccounts', () => { + it('should configure endorsed accounts', async () => { + const { BfpMarketProxy } = systems(); + + const whitelistedHookAddresses = Array.from(Array(genNumber(1, 10))).map(() => genAddress()); + + const { receipt } = await withExplicitEvmMine( + () => BfpMarketProxy.connect(owner()).setEndorsedSplitAccounts(whitelistedHookAddresses), + provider() + ); + + const ownerAddress = await owner().getAddress(); + await assertEvent( + receipt, + `SplitAccountConfigured("${ownerAddress}", ${whitelistedHookAddresses.length})`, + BfpMarketProxy + ); + + assert.deepEqual(await BfpMarketProxy.getEndorsedSplitAccounts(), whitelistedHookAddresses); + }); + + it('should override existing config', async () => { + const { BfpMarketProxy } = systems(); + const addressBefore = genAddress(); + + await BfpMarketProxy.connect(owner()).setEndorsedSplitAccounts([addressBefore]); + + assert.deepEqual(await BfpMarketProxy.getEndorsedSplitAccounts(), [addressBefore]); + + const addressAfter = genAddress(); + await BfpMarketProxy.connect(owner()).setEndorsedSplitAccounts([addressAfter]); + + assert.deepEqual(await BfpMarketProxy.getEndorsedSplitAccounts(), [addressAfter]); + }); + + it('should remove previously whitelisted addresses when passed empty array', async () => { + const { BfpMarketProxy } = systems(); + const addressBefore = genAddress(); + + await BfpMarketProxy.connect(owner()).setEndorsedSplitAccounts([addressBefore]); + + assert.deepEqual(await BfpMarketProxy.getEndorsedSplitAccounts(), [addressBefore]); + + await BfpMarketProxy.connect(owner()).setEndorsedSplitAccounts([]); + + assert.deepEqual(await BfpMarketProxy.getEndorsedSplitAccounts(), []); + }); + + it('should revert when non-owner', async () => { + const { BfpMarketProxy } = systems(); + + const from = traders()[0].signer; // not owner. + + await assertRevert( + BfpMarketProxy.connect(from).setEndorsedSplitAccounts([genAddress()]), + `Unauthorized("${await from.getAddress()}")`, + BfpMarketProxy + ); + }); + + it('should revert is passed 0x address', async () => { + const { BfpMarketProxy } = systems(); + + await assertRevert( + BfpMarketProxy.setEndorsedSplitAccounts([ADDRESS0]), + `ZeroAddress()`, + BfpMarketProxy + ); + }); + }); +}); diff --git a/markets/perps-market/package.json b/markets/perps-market/package.json index 8b6c84f390..9f5a5e9c35 100644 --- a/markets/perps-market/package.json +++ b/markets/perps-market/package.json @@ -32,7 +32,7 @@ "@synthetixio/oracle-manager": "workspace:*", "@synthetixio/spot-market": "workspace:*", "@synthetixio/wei": "^2.74.4", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "hardhat": "^2.19.5", "solidity-docgen": "^0.6.0-beta.36", diff --git a/markets/perps-market/subgraph/package.json b/markets/perps-market/subgraph/package.json index 3c9cda2815..cda79e70cf 100644 --- a/markets/perps-market/subgraph/package.json +++ b/markets/perps-market/subgraph/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@graphprotocol/graph-cli": "^0.68.0", "@graphprotocol/graph-ts": "^0.32.0", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "matchstick-as": "^0.6.0", "prettier": "^3.2.5" diff --git a/markets/perps-market/test/integration/Position/InterestRate.tolerance.test.ts b/markets/perps-market/test/integration/Position/InterestRate.tolerance.test.ts index 1ba6003598..c61a53d401 100644 --- a/markets/perps-market/test/integration/Position/InterestRate.tolerance.test.ts +++ b/markets/perps-market/test/integration/Position/InterestRate.tolerance.test.ts @@ -18,10 +18,11 @@ const interestRateParams = { highUtilGradient: wei(0.01), }; +const TOTAL_DEPOSITED_SNX_USD = bn(250_000); // trader margins deposited below const calculateMinCredit = (useMonthlyPrice: boolean) => { const ethNotional = _TRADER_ETH_SIZE.abs().mul(useMonthlyPrice ? _ETH_MONTHLY_PRICE : _ETH_PRICE); const btcNotional = _TRADER_BTC_SIZE.abs().mul(useMonthlyPrice ? _BTC_MONTHLY_PRICE : _BTC_PRICE); - return ethNotional.add(btcNotional); + return ethNotional.add(btcNotional).add(TOTAL_DEPOSITED_SNX_USD); }; describe('InterestRate.tolerance', () => { diff --git a/markets/spot-market/package.json b/markets/spot-market/package.json index 19c9cf4131..462eb8c056 100644 --- a/markets/spot-market/package.json +++ b/markets/spot-market/package.json @@ -33,7 +33,7 @@ "@synthetixio/oracle-manager": "workspace:*", "@synthetixio/wei": "^2.74.4", "@types/node-fetch": "^2.6.11", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "hardhat": "^2.19.5", "node-fetch": "^2.7.0", diff --git a/markets/spot-market/subgraph/package.json b/markets/spot-market/subgraph/package.json index 7abedc408d..cd95327a93 100644 --- a/markets/spot-market/subgraph/package.json +++ b/markets/spot-market/subgraph/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@graphprotocol/graph-cli": "^0.68.0", "@graphprotocol/graph-ts": "^0.32.0", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "matchstick-as": "^0.6.0", "prettier": "^3.2.5" diff --git a/protocol/governance/package.json b/protocol/governance/package.json index c6cbeff71d..a421903a5c 100644 --- a/protocol/governance/package.json +++ b/protocol/governance/package.json @@ -17,7 +17,7 @@ "@synthetixio/core-modules": "workspace:*", "@synthetixio/core-utils": "workspace:*", "@synthetixio/docgen": "workspace:*", - "@synthetixio/router": "3.3.7", + "@synthetixio/router": "3.4.0", "hardhat": "^2.19.5", "solidity-docgen": "^0.6.0-beta.36" } diff --git a/protocol/synthetix/subgraph/arbitrum-mainnet/generated/CoreProxy/CoreProxy.ts b/protocol/synthetix/subgraph/arbitrum-mainnet/generated/CoreProxy/CoreProxy.ts index d31367ce68..cd95aa65eb 100644 --- a/protocol/synthetix/subgraph/arbitrum-mainnet/generated/CoreProxy/CoreProxy.ts +++ b/protocol/synthetix/subgraph/arbitrum-mainnet/generated/CoreProxy/CoreProxy.ts @@ -6258,6 +6258,56 @@ export class DistributeRewardsCall__Outputs { } } +export class DistributeRewardsByOwnerCall extends ethereum.Call { + get inputs(): DistributeRewardsByOwnerCall__Inputs { + return new DistributeRewardsByOwnerCall__Inputs(this); + } + + get outputs(): DistributeRewardsByOwnerCall__Outputs { + return new DistributeRewardsByOwnerCall__Outputs(this); + } +} + +export class DistributeRewardsByOwnerCall__Inputs { + _call: DistributeRewardsByOwnerCall; + + constructor(call: DistributeRewardsByOwnerCall) { + this._call = call; + } + + get poolId(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get collateralType(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get rewardsDistributor(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get amount(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get start(): BigInt { + return this._call.inputValues[4].value.toBigInt(); + } + + get duration(): BigInt { + return this._call.inputValues[5].value.toBigInt(); + } +} + +export class DistributeRewardsByOwnerCall__Outputs { + _call: DistributeRewardsByOwnerCall; + + constructor(call: DistributeRewardsByOwnerCall) { + this._call = call; + } +} + export class RegisterRewardsDistributorCall extends ethereum.Call { get inputs(): RegisterRewardsDistributorCall__Inputs { return new RegisterRewardsDistributorCall__Inputs(this); diff --git a/protocol/synthetix/subgraph/codegen.sh b/protocol/synthetix/subgraph/codegen.sh index 1037e7a102..dd9687db42 100755 --- a/protocol/synthetix/subgraph/codegen.sh +++ b/protocol/synthetix/subgraph/codegen.sh @@ -43,5 +43,5 @@ codegen sepolia 11155111 "synthetix-omnibus:latest@main" codegen optimism-mainnet 10 "synthetix-omnibus:latest@main" # Arbitrum -codegen arbitrum-mainnet 42161 "synthetix-omnibus:latest@arbthetix" +codegen arbitrum-mainnet 42161 "synthetix-omnibus:latest@main" codegen arbitrum-sepolia 421614 "synthetix-omnibus:latest@main" diff --git a/protocol/synthetix/subgraph/package.json b/protocol/synthetix/subgraph/package.json index 2bbd601c28..e02e5e0907 100644 --- a/protocol/synthetix/subgraph/package.json +++ b/protocol/synthetix/subgraph/package.json @@ -12,7 +12,7 @@ "alchemy:sepolia": "graph deploy synthetix-sepolia subgraph.sepolia.yaml --output-dir ./build/sepolia --version-label v1 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $SATSUMA_KEY --ipfs https://ipfs.satsuma.xyz", "alchemy:base-mainnet-andromeda": "graph deploy synthetix-base-mainnet-andromeda subgraph.base-mainnet-andromeda.yaml --output-dir ./build/base-mainnet-andromeda --version-label v1 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $SATSUMA_KEY --ipfs https://ipfs.satsuma.xyz", "alchemy:base-sepolia-andromeda": "graph deploy synthetix-base-sepolia-andromeda subgraph.base-sepolia-andromeda.yaml --output-dir ./build/base-sepolia-andromeda --version-label v1 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $SATSUMA_KEY --ipfs https://ipfs.satsuma.xyz", - "alchemy:arbitrum-mainnet": "graph deploy synthetix-arbitrum-mainnet subgraph.arbitrum-mainnet.yaml --output-dir ./build/arbitrum-mainnet --version-label v1 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $SATSUMA_KEY --ipfs https://ipfs.satsuma.xyz", + "alchemy:arbitrum-mainnet": "graph deploy synthetix-arbitrum-mainnet subgraph.arbitrum-mainnet.yaml --output-dir ./build/arbitrum-mainnet --version-label v1.0.3 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $SATSUMA_KEY --ipfs https://ipfs.satsuma.xyz", "alchemy:arbitrum-sepolia": "graph deploy synthetix-arbitrum-sepolia subgraph.arbitrum-sepolia.yaml --output-dir ./build/arbitrum-sepolia --version-label v1 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $SATSUMA_KEY --ipfs https://ipfs.satsuma.xyz", "alchemy:optimism-mainnet": "graph deploy synthetix-optimism-mainnet subgraph.optimism-mainnet.yaml --output-dir ./build/optimism-mainnet --version-label v1 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $SATSUMA_KEY --ipfs https://ipfs.satsuma.xyz", "test": "graph test", @@ -24,7 +24,7 @@ "devDependencies": { "@graphprotocol/graph-cli": "^0.68.0", "@graphprotocol/graph-ts": "^0.32.0", - "@usecannon/cli": "2.13.6", + "@usecannon/cli": "2.15.2", "ethers": "^5.7.2", "matchstick-as": "^0.6.0", "prettier": "^3.2.5" diff --git a/protocol/synthetix/subgraph/sepolia/generated/CoreProxy/CoreProxy.ts b/protocol/synthetix/subgraph/sepolia/generated/CoreProxy/CoreProxy.ts index bc2341f8cc..d31367ce68 100644 --- a/protocol/synthetix/subgraph/sepolia/generated/CoreProxy/CoreProxy.ts +++ b/protocol/synthetix/subgraph/sepolia/generated/CoreProxy/CoreProxy.ts @@ -758,6 +758,22 @@ export class MarketCollateralDeposited__Params { get sender(): Address { return this._event.parameters[3].value.toAddress(); } + + get creditCapacity(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get netIssuance(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get depositedCollateralValue(): BigInt { + return this._event.parameters[6].value.toBigInt(); + } + + get reportedDebt(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } } export class MarketCollateralWithdrawn extends ethereum.Event { @@ -788,6 +804,22 @@ export class MarketCollateralWithdrawn__Params { get sender(): Address { return this._event.parameters[3].value.toAddress(); } + + get creditCapacity(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get netIssuance(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get depositedCollateralValue(): BigInt { + return this._event.parameters[6].value.toBigInt(); + } + + get reportedDebt(): BigInt { + return this._event.parameters[7].value.toBigInt(); + } } export class MaximumMarketCollateralConfigured extends ethereum.Event { @@ -896,6 +928,18 @@ export class MarketUsdDeposited__Params { get market(): Address { return this._event.parameters[3].value.toAddress(); } + + get creditCapacity(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get netIssuance(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get depositedCollateralValue(): BigInt { + return this._event.parameters[6].value.toBigInt(); + } } export class MarketUsdWithdrawn extends ethereum.Event { @@ -926,6 +970,18 @@ export class MarketUsdWithdrawn__Params { get market(): Address { return this._event.parameters[3].value.toAddress(); } + + get creditCapacity(): BigInt { + return this._event.parameters[4].value.toBigInt(); + } + + get netIssuance(): BigInt { + return this._event.parameters[5].value.toBigInt(); + } + + get depositedCollateralValue(): BigInt { + return this._event.parameters[6].value.toBigInt(); + } } export class SetMarketMinLiquidityRatio extends ethereum.Event { @@ -1270,6 +1326,28 @@ export class PoolOwnershipAccepted__Params { } } +export class PoolOwnershipRenounced extends ethereum.Event { + get params(): PoolOwnershipRenounced__Params { + return new PoolOwnershipRenounced__Params(this); + } +} + +export class PoolOwnershipRenounced__Params { + _event: PoolOwnershipRenounced; + + constructor(event: PoolOwnershipRenounced) { + this._event = event; + } + + get poolId(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get owner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + export class SetMinLiquidityRatio extends ethereum.Event { get params(): SetMinLiquidityRatio__Params { return new SetMinLiquidityRatio__Params(this); @@ -1715,6 +1793,16 @@ export class CoreProxy__getMarketPoolsResult { } } +export class CoreProxy__getPoolCollateralConfigurationResultConfigStruct extends ethereum.Tuple { + get collateralLimitD18(): BigInt { + return this[0].toBigInt(); + } + + get issuanceRatioD18(): BigInt { + return this[1].toBigInt(); + } +} + export class CoreProxy__getPoolConfigurationResultValue0Struct extends ethereum.Tuple { get marketId(): BigInt { return this[0].toBigInt(); @@ -1793,31 +1881,6 @@ export class CoreProxy__getPositionResult { } } -export class CoreProxy__getPositionCollateralResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set('value0', ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set('value1', ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getAmount(): BigInt { - return this.value0; - } - - getValue(): BigInt { - return this.value1; - } -} - export class CoreProxy__getVaultCollateralResult { value0: BigInt; value1: BigInt; @@ -3105,40 +3168,6 @@ export class CoreProxy extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - getMessageSender(): Address { - let result = super.call('getMessageSender', 'getMessageSender():(address)', []); - - return result[0].toAddress(); - } - - try_getMessageSender(): ethereum.CallResult
{ - let result = super.tryCall('getMessageSender', 'getMessageSender():(address)', []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - multicall(data: Array): Array { - let result = super.call('multicall', 'multicall(bytes[]):(bytes[])', [ - ethereum.Value.fromBytesArray(data), - ]); - - return result[0].toBytesArray(); - } - - try_multicall(data: Array): ethereum.CallResult> { - let result = super.tryCall('multicall', 'multicall(bytes[]):(bytes[])', [ - ethereum.Value.fromBytesArray(data), - ]); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBytesArray()); - } - getApprovedPools(): Array { let result = super.call('getApprovedPools', 'getApprovedPools():(uint256[])', []); @@ -3205,6 +3234,39 @@ export class CoreProxy extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } + getPoolCollateralConfiguration( + poolId: BigInt, + collateralType: Address + ): CoreProxy__getPoolCollateralConfigurationResultConfigStruct { + let result = super.call( + 'getPoolCollateralConfiguration', + 'getPoolCollateralConfiguration(uint128,address):((uint256,uint256))', + [ethereum.Value.fromUnsignedBigInt(poolId), ethereum.Value.fromAddress(collateralType)] + ); + + return changetype( + result[0].toTuple() + ); + } + + try_getPoolCollateralConfiguration( + poolId: BigInt, + collateralType: Address + ): ethereum.CallResult { + let result = super.tryCall( + 'getPoolCollateralConfiguration', + 'getPoolCollateralConfiguration(uint128,address):((uint256,uint256))', + [ethereum.Value.fromUnsignedBigInt(poolId), ethereum.Value.fromAddress(collateralType)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype(value[0].toTuple()) + ); + } + getPoolCollateralIssuanceRatio(poolId: BigInt, collateral: Address): BigInt { let result = super.call( 'getPoolCollateralIssuanceRatio', @@ -3339,6 +3401,49 @@ export class CoreProxy extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } + getAvailableRewards( + accountId: BigInt, + poolId: BigInt, + collateralType: Address, + distributor: Address + ): BigInt { + let result = super.call( + 'getAvailableRewards', + 'getAvailableRewards(uint128,uint128,address,address):(uint256)', + [ + ethereum.Value.fromUnsignedBigInt(accountId), + ethereum.Value.fromUnsignedBigInt(poolId), + ethereum.Value.fromAddress(collateralType), + ethereum.Value.fromAddress(distributor), + ] + ); + + return result[0].toBigInt(); + } + + try_getAvailableRewards( + accountId: BigInt, + poolId: BigInt, + collateralType: Address, + distributor: Address + ): ethereum.CallResult { + let result = super.tryCall( + 'getAvailableRewards', + 'getAvailableRewards(uint128,uint128,address,address):(uint256)', + [ + ethereum.Value.fromUnsignedBigInt(accountId), + ethereum.Value.fromUnsignedBigInt(poolId), + ethereum.Value.fromAddress(collateralType), + ethereum.Value.fromAddress(distributor), + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + getRewardRate(poolId: BigInt, collateralType: Address, distributor: Address): BigInt { let result = super.call('getRewardRate', 'getRewardRate(uint128,address,address):(uint256)', [ ethereum.Value.fromUnsignedBigInt(poolId), @@ -3471,6 +3576,40 @@ export class CoreProxy extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } + getTrustedForwarder(): Address { + let result = super.call('getTrustedForwarder', 'getTrustedForwarder():(address)', []); + + return result[0].toAddress(); + } + + try_getTrustedForwarder(): ethereum.CallResult
{ + let result = super.tryCall('getTrustedForwarder', 'getTrustedForwarder():(address)', []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + isTrustedForwarder(forwarder: Address): boolean { + let result = super.call('isTrustedForwarder', 'isTrustedForwarder(address):(bool)', [ + ethereum.Value.fromAddress(forwarder), + ]); + + return result[0].toBoolean(); + } + + try_isTrustedForwarder(forwarder: Address): ethereum.CallResult { + let result = super.tryCall('isTrustedForwarder', 'isTrustedForwarder(address):(bool)', [ + ethereum.Value.fromAddress(forwarder), + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + setSupportedCrossChainNetworks( supportedNetworks: Array, ccipSelectors: Array @@ -3576,14 +3715,10 @@ export class CoreProxy extends ethereum.SmartContract { ); } - getPositionCollateral( - accountId: BigInt, - poolId: BigInt, - collateralType: Address - ): CoreProxy__getPositionCollateralResult { + getPositionCollateral(accountId: BigInt, poolId: BigInt, collateralType: Address): BigInt { let result = super.call( 'getPositionCollateral', - 'getPositionCollateral(uint128,uint128,address):(uint256,uint256)', + 'getPositionCollateral(uint128,uint128,address):(uint256)', [ ethereum.Value.fromUnsignedBigInt(accountId), ethereum.Value.fromUnsignedBigInt(poolId), @@ -3591,17 +3726,17 @@ export class CoreProxy extends ethereum.SmartContract { ] ); - return new CoreProxy__getPositionCollateralResult(result[0].toBigInt(), result[1].toBigInt()); + return result[0].toBigInt(); } try_getPositionCollateral( accountId: BigInt, poolId: BigInt, collateralType: Address - ): ethereum.CallResult { + ): ethereum.CallResult { let result = super.tryCall( 'getPositionCollateral', - 'getPositionCollateral(uint128,uint128,address):(uint256,uint256)', + 'getPositionCollateral(uint128,uint128,address):(uint256)', [ ethereum.Value.fromUnsignedBigInt(accountId), ethereum.Value.fromUnsignedBigInt(poolId), @@ -3612,9 +3747,7 @@ export class CoreProxy extends ethereum.SmartContract { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue( - new CoreProxy__getPositionCollateralResult(value[0].toBigInt(), value[1].toBigInt()) - ); + return ethereum.CallResult.fromValue(value[0].toBigInt()); } getPositionCollateralRatio(accountId: BigInt, poolId: BigInt, collateralType: Address): BigInt { @@ -5525,116 +5658,6 @@ export class WithdrawMarketUsdCall__Outputs { } } -export class MulticallCall extends ethereum.Call { - get inputs(): MulticallCall__Inputs { - return new MulticallCall__Inputs(this); - } - - get outputs(): MulticallCall__Outputs { - return new MulticallCall__Outputs(this); - } -} - -export class MulticallCall__Inputs { - _call: MulticallCall; - - constructor(call: MulticallCall) { - this._call = call; - } - - get data(): Array { - return this._call.inputValues[0].value.toBytesArray(); - } -} - -export class MulticallCall__Outputs { - _call: MulticallCall; - - constructor(call: MulticallCall) { - this._call = call; - } - - get results(): Array { - return this._call.outputValues[0].value.toBytesArray(); - } -} - -export class MulticallThroughCall extends ethereum.Call { - get inputs(): MulticallThroughCall__Inputs { - return new MulticallThroughCall__Inputs(this); - } - - get outputs(): MulticallThroughCall__Outputs { - return new MulticallThroughCall__Outputs(this); - } -} - -export class MulticallThroughCall__Inputs { - _call: MulticallThroughCall; - - constructor(call: MulticallThroughCall) { - this._call = call; - } - - get to(): Array
{ - return this._call.inputValues[0].value.toAddressArray(); - } - - get data(): Array { - return this._call.inputValues[1].value.toBytesArray(); - } - - get values(): Array { - return this._call.inputValues[2].value.toBigIntArray(); - } -} - -export class MulticallThroughCall__Outputs { - _call: MulticallThroughCall; - - constructor(call: MulticallThroughCall) { - this._call = call; - } - - get results(): Array { - return this._call.outputValues[0].value.toBytesArray(); - } -} - -export class SetAllowlistedMulticallTargetCall extends ethereum.Call { - get inputs(): SetAllowlistedMulticallTargetCall__Inputs { - return new SetAllowlistedMulticallTargetCall__Inputs(this); - } - - get outputs(): SetAllowlistedMulticallTargetCall__Outputs { - return new SetAllowlistedMulticallTargetCall__Outputs(this); - } -} - -export class SetAllowlistedMulticallTargetCall__Inputs { - _call: SetAllowlistedMulticallTargetCall; - - constructor(call: SetAllowlistedMulticallTargetCall) { - this._call = call; - } - - get target(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get allowlisted(): boolean { - return this._call.inputValues[1].value.toBoolean(); - } -} - -export class SetAllowlistedMulticallTargetCall__Outputs { - _call: SetAllowlistedMulticallTargetCall; - - constructor(call: SetAllowlistedMulticallTargetCall) { - this._call = call; - } -} - export class AddApprovedPoolCall extends ethereum.Call { get inputs(): AddApprovedPoolCall__Inputs { return new AddApprovedPoolCall__Inputs(this); @@ -5887,6 +5910,36 @@ export class RenouncePoolNominationCall__Outputs { } } +export class RenouncePoolOwnershipCall extends ethereum.Call { + get inputs(): RenouncePoolOwnershipCall__Inputs { + return new RenouncePoolOwnershipCall__Inputs(this); + } + + get outputs(): RenouncePoolOwnershipCall__Outputs { + return new RenouncePoolOwnershipCall__Outputs(this); + } +} + +export class RenouncePoolOwnershipCall__Inputs { + _call: RenouncePoolOwnershipCall; + + constructor(call: RenouncePoolOwnershipCall) { + this._call = call; + } + + get poolId(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class RenouncePoolOwnershipCall__Outputs { + _call: RenouncePoolOwnershipCall; + + constructor(call: RenouncePoolOwnershipCall) { + this._call = call; + } +} + export class RevokePoolNominationCall extends ethereum.Call { get inputs(): RevokePoolNominationCall__Inputs { return new RevokePoolNominationCall__Inputs(this); diff --git a/protocol/synthetix/subgraph/subgraph.arbitrum-mainnet.yaml b/protocol/synthetix/subgraph/subgraph.arbitrum-mainnet.yaml index 809119b16a..e06f33a73e 100644 --- a/protocol/synthetix/subgraph/subgraph.arbitrum-mainnet.yaml +++ b/protocol/synthetix/subgraph/subgraph.arbitrum-mainnet.yaml @@ -7,7 +7,7 @@ dataSources: name: CoreProxy source: abi: CoreProxy - address: "0x4Ab09F627fa9706f33178129005300Fd4c00EDF1" + address: "0xffffffaEff0B96Ea8e4f94b2253f31abdD875847" startBlock: 190322191 mapping: kind: ethereum/events diff --git a/protocol/synthetix/subgraph/subgraph.sepolia.yaml b/protocol/synthetix/subgraph/subgraph.sepolia.yaml index 521f808643..94d5f26256 100644 --- a/protocol/synthetix/subgraph/subgraph.sepolia.yaml +++ b/protocol/synthetix/subgraph/subgraph.sepolia.yaml @@ -52,14 +52,6 @@ dataSources: handler: handlePoolConfigurationSet - event: MarketRegistered(indexed address,indexed uint128,indexed address) handler: handleMarketCreated - - event: - MarketUsdDeposited(indexed uint128,indexed address,uint256,indexed - address) - handler: handleMarketUsdDeposited - - event: - MarketUsdWithdrawn(indexed uint128,indexed address,uint256,indexed - address) - handler: handleMarketUsdWithdrawn - event: Deposited(indexed uint128,indexed address,uint256,indexed address) handler: handleCollateralDeposited - event: Withdrawn(indexed uint128,indexed address,uint256,indexed address) diff --git a/utils/common-config/package.json b/utils/common-config/package.json index 6919db180b..9723421ba9 100644 --- a/utils/common-config/package.json +++ b/utils/common-config/package.json @@ -17,7 +17,7 @@ "@typechain/hardhat": "^9.1.0", "dotenv": "^16.4.3", "hardhat": "^2.19.5", - "hardhat-cannon": "2.13.6", + "hardhat-cannon": "2.15.2", "hardhat-contract-sizer": "^2.10.0", "hardhat-gas-reporter": "^1.0.10", "hardhat-ignore-warnings": "^0.2.9", diff --git a/utils/core-utils/package.json b/utils/core-utils/package.json index a2ad4da784..7ecd7cd874 100644 --- a/utils/core-utils/package.json +++ b/utils/core-utils/package.json @@ -40,7 +40,7 @@ "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/micromatch": "^4", "@types/prompts": "^2.4.9", - "@usecannon/builder": "2.13.6", + "@usecannon/builder": "2.15.2", "ethers": "^5.7.2", "hardhat": "^2.19.5", "mocha": "^10.3.0", diff --git a/utils/sample-project/package.json b/utils/sample-project/package.json index 52a0b7b96f..abffe44c6d 100644 --- a/utils/sample-project/package.json +++ b/utils/sample-project/package.json @@ -17,10 +17,10 @@ "@synthetixio/core-modules": "workspace:*", "@synthetixio/core-utils": "workspace:*", "@synthetixio/hardhat-storage": "workspace:*", - "@synthetixio/router": "3.3.7", + "@synthetixio/router": "3.4.0", "ethers": "^5.7.2", "hardhat": "^2.19.5", - "hardhat-cannon": "2.13.6", + "hardhat-cannon": "2.15.2", "solidity-coverage": "^0.8.7" } } diff --git a/yarn.lock b/yarn.lock index e742e43dec..031272c967 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2911,7 +2911,7 @@ __metadata: "@synthetixio/wei": "npm:^2.74.4" "@types/lodash": "npm:^4.14.199" "@types/mocha-each": "npm:2.0.1" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" hardhat: "npm:^2.19.5" lodash: "npm:^4.17.21" @@ -2951,7 +2951,7 @@ __metadata: "@typechain/hardhat": "npm:^9.1.0" dotenv: "npm:^16.4.3" hardhat: "npm:^2.19.5" - hardhat-cannon: "npm:2.13.6" + hardhat-cannon: "npm:2.15.2" hardhat-contract-sizer: "npm:^2.10.0" hardhat-gas-reporter: "npm:^1.0.10" hardhat-ignore-warnings: "npm:^0.2.9" @@ -2990,7 +2990,7 @@ __metadata: dependencies: "@graphprotocol/graph-cli": "npm:^0.68.0" "@graphprotocol/graph-ts": "npm:^0.32.0" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" matchstick-as: "npm:^0.6.0" prettier: "npm:^3.2.5" @@ -3005,7 +3005,7 @@ __metadata: "@istanbuljs/nyc-config-typescript": "npm:^1.0.2" "@types/micromatch": "npm:^4" "@types/prompts": "npm:^2.4.9" - "@usecannon/builder": "npm:2.13.6" + "@usecannon/builder": "npm:2.15.2" chalk: "npm:^4.1.2" ethereumjs-util: "npm:^7.1.5" ethers: "npm:^5.7.2" @@ -3069,7 +3069,7 @@ __metadata: "@synthetixio/docgen": "workspace:*" "@synthetixio/main": "workspace:*" "@synthetixio/wei": "npm:^2.74.4" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" hardhat: "npm:^2.19.5" solidity-docgen: "npm:^0.6.0-beta.36" @@ -3085,7 +3085,7 @@ __metadata: "@synthetixio/core-modules": "workspace:*" "@synthetixio/core-utils": "workspace:*" "@synthetixio/docgen": "workspace:*" - "@synthetixio/router": "npm:3.3.7" + "@synthetixio/router": "npm:3.4.0" hardhat: "npm:^2.19.5" solidity-docgen: "npm:^0.6.0-beta.36" languageName: unknown @@ -3180,7 +3180,7 @@ __metadata: dependencies: "@graphprotocol/graph-cli": "npm:^0.68.0" "@graphprotocol/graph-ts": "npm:^0.32.0" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" matchstick-as: "npm:^0.6.0" prettier: "npm:^3.2.5" @@ -3200,7 +3200,7 @@ __metadata: "@synthetixio/oracle-manager": "workspace:*" "@synthetixio/spot-market": "workspace:*" "@synthetixio/wei": "npm:^2.74.4" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" hardhat: "npm:^2.19.5" solidity-docgen: "npm:^0.6.0-beta.36" @@ -3228,7 +3228,7 @@ __metadata: version: 0.0.0-use.local resolution: "@synthetixio/rewards-dist-ext@workspace:auxiliary/RewardsDistributorExternal" dependencies: - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" forge-std: "github:foundry-rs/forge-std#master" languageName: unknown linkType: soft @@ -3237,14 +3237,14 @@ __metadata: version: 0.0.0-use.local resolution: "@synthetixio/rewards-distributor@workspace:auxiliary/RewardsDistributor" dependencies: - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" forge-std: "github:foundry-rs/forge-std#master" languageName: unknown linkType: soft -"@synthetixio/router@npm:3.3.7, @synthetixio/router@npm:^3.3.7": - version: 3.3.7 - resolution: "@synthetixio/router@npm:3.3.7" +"@synthetixio/router@npm:3.4.0, @synthetixio/router@npm:^3.4.0": + version: 3.4.0 + resolution: "@synthetixio/router@npm:3.4.0" dependencies: "@ethersproject/keccak256": "npm:^5.7.0" debug: "npm:^4.3.4" @@ -3252,7 +3252,7 @@ __metadata: peerDependencies: hardhat: ^2.0.0 solc: ^0.8.17 - checksum: 10/f79d119b249c556ca083e4654ca633c179085f9948933ecbb9aaadced83a5fae74dd6b7c91ac7edd702895fe98d65a7d397d7635d2ce6a059a413101c46e2ecb + checksum: 10/da0db66e85b5dbd684563df4160cc0e74809c1a69fd455407efde994a37c8509ebf6c298f5708175e79cb62f89d7fa397646304e00b3fa948bb738dc7d664cdd languageName: node linkType: hard @@ -3265,10 +3265,10 @@ __metadata: "@synthetixio/core-modules": "workspace:*" "@synthetixio/core-utils": "workspace:*" "@synthetixio/hardhat-storage": "workspace:*" - "@synthetixio/router": "npm:3.3.7" + "@synthetixio/router": "npm:3.4.0" ethers: "npm:^5.7.2" hardhat: "npm:^2.19.5" - hardhat-cannon: "npm:2.13.6" + hardhat-cannon: "npm:2.15.2" solidity-coverage: "npm:^0.8.7" languageName: unknown linkType: soft @@ -3294,7 +3294,7 @@ __metadata: dependencies: "@graphprotocol/graph-cli": "npm:^0.68.0" "@graphprotocol/graph-ts": "npm:^0.32.0" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" matchstick-as: "npm:^0.6.0" prettier: "npm:^3.2.5" @@ -3314,7 +3314,7 @@ __metadata: "@synthetixio/oracle-manager": "workspace:*" "@synthetixio/wei": "npm:^2.74.4" "@types/node-fetch": "npm:^2.6.11" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" hardhat: "npm:^2.19.5" node-fetch: "npm:^2.7.0" @@ -3345,7 +3345,7 @@ __metadata: "@synthetixio/docgen": "workspace:*" "@synthetixio/main": "workspace:*" "@synthetixio/wei": "npm:^2.74.4" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/cli": "npm:2.15.2" ethers: "npm:^5.7.2" hardhat: "npm:^2.19.5" solidity-docgen: "npm:^0.6.0-beta.36" @@ -3978,52 +3978,52 @@ __metadata: languageName: node linkType: hard -"@usecannon/builder@npm:2.13.6": - version: 2.13.6 - resolution: "@usecannon/builder@npm:2.13.6" +"@usecannon/builder@npm:2.15.2": + version: 2.15.2 + resolution: "@usecannon/builder@npm:2.15.2" dependencies: - "@synthetixio/router": "npm:^3.3.7" - axios: "npm:^1.6.7" - axios-retry: "npm:^4.0.0" + "@synthetixio/router": "npm:^3.4.0" + axios: "npm:^1.6.8" + axios-retry: "npm:^4.1.0" buffer: "npm:^6.0.3" + chalk: "npm:^4.1.2" debug: "npm:^4.3.4" form-data: "npm:^4.0.0" lodash: "npm:^4.17.21" pako: "npm:^2.1.0" promise-events: "npm:^0.2.4" - typedoc-plugin-markdown: "npm:^3.17.1" typestub-ipfs-only-hash: "npm:^4.0.0" - viem: "npm:^2.9.26" - zod: "npm:^3.22.4" - checksum: 10/6fdff249d7368ad4b351e2a0580b86d825960cb552d67573be96217deea563017632ee12db1239fb0b30d3dbf37b4c9b7eb33f32c5a97b3c5f6e3a288e91db05 + viem: "npm:^2.9.31" + zod: "npm:^3.23.6" + checksum: 10/86716e885fa4b786739870110093f28922eb5643cb430decdcea79547c0576edf6992c1ad7f71ad405f93643392c23c39615f3aa0f92d11d515f1835d76ba773 languageName: node linkType: hard -"@usecannon/cli@npm:2.13.6": - version: 2.13.6 - resolution: "@usecannon/cli@npm:2.13.6" +"@usecannon/cli@npm:2.15.2": + version: 2.15.2 + resolution: "@usecannon/cli@npm:2.15.2" dependencies: "@iarna/toml": "npm:^3.0.0" - "@usecannon/builder": "npm:2.13.6" - abitype: "npm:^1.0.0" + "@usecannon/builder": "npm:2.15.2" + abitype: "npm:^1.0.2" chalk: "npm:^4.1.2" commander: "npm:^9.5.0" debug: "npm:^4.3.4" eth-provider: "npm:^0.13.6" - fastq: "npm:^1.15.0" - fs-extra: "npm:^10.1.0" + fastq: "npm:^1.17.1" + fs-extra: "npm:^11.2.0" lodash: "npm:^4.17.21" prompts: "npm:^2.4.2" - semver: "npm:^7.3.7" - table: "npm:^6.8.0" - tildify: "npm:2.0.0" + semver: "npm:^7.6.0" + table: "npm:^6.8.2" + tildify: "npm:3.0.0" untildify: "npm:^4.0.0" - viem: "npm:^2.9.26" + viem: "npm:^2.9.31" znv: "npm:^0.4.0" - zod: "npm:^3.22.4" + zod: "npm:^3.23.6" bin: cannon: bin/cannon.js - checksum: 10/b644c24db8356b5b8f1c1da96745ba64cc951d674768df6c56eb6746895ac462d6bc718fe9568f945487ed7f30c9e3afbea675d952d7a9b94a378ae96a3614f0 + checksum: 10/da2730754f185507d32c519cce4e94b8afe16c55eb9ee58623799b18f23ad436bd1fb8f9878b10ab90c9db449797d04b8513b8d85527913dd59f4b4c25d3ae3f languageName: node linkType: hard @@ -4175,7 +4175,7 @@ __metadata: languageName: node linkType: hard -"abitype@npm:1.0.0, abitype@npm:^1.0.0": +"abitype@npm:1.0.0": version: 1.0.0 resolution: "abitype@npm:1.0.0" peerDependencies: @@ -4190,6 +4190,21 @@ __metadata: languageName: node linkType: hard +"abitype@npm:^1.0.2": + version: 1.0.2 + resolution: "abitype@npm:1.0.2" + peerDependencies: + typescript: ">=5.0.4" + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + checksum: 10/d80d10521e42732df96c6ba42d42dbfe6214d3328990a618195d9986a42584040eaa54fb861adce5ccd50df0ffdfbb4928505ed7d6468893cf64509bf4138a0a + languageName: node + linkType: hard + "abort-controller@npm:^3.0.0": version: 3.0.0 resolution: "abort-controller@npm:3.0.0" @@ -4822,14 +4837,14 @@ __metadata: languageName: node linkType: hard -"axios-retry@npm:^4.0.0": - version: 4.0.0 - resolution: "axios-retry@npm:4.0.0" +"axios-retry@npm:^4.1.0": + version: 4.4.0 + resolution: "axios-retry@npm:4.4.0" dependencies: is-retry-allowed: "npm:^2.2.0" peerDependencies: axios: 0.x || 1.x - checksum: 10/40c72837540a768dd7d7e98b0243395f46a59b623e5e37a7bdd164ba748404783fe68c6284c793b8cdd6e51b006560ed093a3db50587fb13f1e192df26803c96 + checksum: 10/b1c60803ef67233e76bf36e8811765b9d3d21b74574c872c1fd6a4e526d0537f212f3e13bf47cebb2876b13cee2995cd39a0a3cfeb6e1c1513ed3fa9210ce5e1 languageName: node linkType: hard @@ -4842,14 +4857,14 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.6.7": - version: 1.6.7 - resolution: "axios@npm:1.6.7" +"axios@npm:^1.6.8": + version: 1.7.2 + resolution: "axios@npm:1.7.2" dependencies: - follow-redirects: "npm:^1.15.4" + follow-redirects: "npm:^1.15.6" form-data: "npm:^4.0.0" proxy-from-env: "npm:^1.1.0" - checksum: 10/a1932b089ece759cd261f175d9ebf4d41c8994cf0c0767cda86055c7a19bcfdade8ae3464bf4cec4c8b142f4a657dc664fb77a41855e8376cf38b86d7a86518f + checksum: 10/6ae80dda9736bb4762ce717f1a26ff997d94672d3a5799ad9941c24d4fb019c1dff45be8272f08d1975d7950bac281f3ba24aff5ecd49ef5a04d872ec428782f languageName: node linkType: hard @@ -7723,12 +7738,12 @@ __metadata: languageName: node linkType: hard -"fastq@npm:^1.15.0, fastq@npm:^1.6.0": - version: 1.15.0 - resolution: "fastq@npm:1.15.0" +"fastq@npm:^1.17.1, fastq@npm:^1.6.0": + version: 1.17.1 + resolution: "fastq@npm:1.17.1" dependencies: reusify: "npm:^1.0.4" - checksum: 10/67c01b1c972e2d5b6fea197a1a39d5d582982aea69ff4c504badac71080d8396d4843b165a9686e907c233048f15a86bbccb0e7f83ba771f6fa24bcde059d0c3 + checksum: 10/a443180068b527dd7b3a63dc7f2a47ceca2f3e97b9c00a1efe5538757e6cc4056a3526df94308075d7727561baf09ebaa5b67da8dcbddb913a021c5ae69d1f69 languageName: node linkType: hard @@ -7904,13 +7919,13 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.12.1, follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.15.4": - version: 1.15.5 - resolution: "follow-redirects@npm:1.15.5" +"follow-redirects@npm:^1.12.1, follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.15.6": + version: 1.15.6 + resolution: "follow-redirects@npm:1.15.6" peerDependenciesMeta: debug: optional: true - checksum: 10/d467f13c1c6aa734599b8b369cd7a625b20081af358f6204ff515f6f4116eb440de9c4e0c49f10798eeb0df26c95dd05d5e0d9ddc5786ab1a8a8abefe92929b4 + checksum: 10/70c7612c4cab18e546e36b991bbf8009a1a41cf85354afe04b113d1117569abf760269409cb3eb842d9f7b03d62826687086b081c566ea7b1e6613cf29030bf7 languageName: node linkType: hard @@ -8059,17 +8074,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^10.0.1, fs-extra@npm:^10.1.0": - version: 10.1.0 - resolution: "fs-extra@npm:10.1.0" - dependencies: - graceful-fs: "npm:^4.2.0" - jsonfile: "npm:^6.0.1" - universalify: "npm:^2.0.0" - checksum: 10/05ce2c3b59049bcb7b52001acd000e44b3c4af4ec1f8839f383ef41ec0048e3cfa7fd8a637b1bddfefad319145db89be91f4b7c1db2908205d38bf91e7d1d3b7 - languageName: node - linkType: hard - "fs-extra@npm:^11.2.0": version: 11.2.0 resolution: "fs-extra@npm:11.2.0" @@ -8803,20 +8807,20 @@ __metadata: languageName: node linkType: hard -"hardhat-cannon@npm:2.13.6": - version: 2.13.6 - resolution: "hardhat-cannon@npm:2.13.6" +"hardhat-cannon@npm:2.15.2": + version: 2.15.2 + resolution: "hardhat-cannon@npm:2.15.2" dependencies: "@iarna/toml": "npm:^3.0.0" - "@usecannon/builder": "npm:2.13.6" - "@usecannon/cli": "npm:2.13.6" + "@usecannon/builder": "npm:2.15.2" + "@usecannon/cli": "npm:2.15.2" chalk: "npm:^4.1.2" - debug: "npm:^4.3.3" - fs-extra: "npm:^10.0.1" - viem: "npm:^2.9.26" + debug: "npm:^4.3.4" + fs-extra: "npm:^11.2.0" + viem: "npm:^2.9.31" peerDependencies: hardhat: ">=2.0.0" - checksum: 10/b671b0ad168aa2cd068bfcbde2e6194f7b327025d6146142547b4cc9b46cf7b719ee737e3051d0d7375ac6c47b49b361ec5921d6ec4c9ec7f7b2beeeb0a5e26c + checksum: 10/c52d4dd9719f5dd1bb28168dc6f935d95dce6459c4ac8b79b45e7e9c77bb51ae690472b9973ce95bfe3bf51fcecf77749399f13184d1eca4ebf2825e1f4de042 languageName: node linkType: hard @@ -10069,12 +10073,12 @@ __metadata: languageName: node linkType: hard -"isows@npm:1.0.3": - version: 1.0.3 - resolution: "isows@npm:1.0.3" +"isows@npm:1.0.4": + version: 1.0.4 + resolution: "isows@npm:1.0.4" peerDependencies: ws: "*" - checksum: 10/9cacd5cf59f67deb51e825580cd445ab1725ecb05a67c704050383fb772856f3cd5e7da8ad08f5a3bd2823680d77d099459d0c6a7037972a74d6429af61af440 + checksum: 10/a3ee62e3d6216abb3adeeb2a551fe2e7835eac87b05a6ecc3e7739259bf5f8e83290501f49e26137390c8093f207fc3378d4a7653aab76ad7bbab4b2dba9c5b9 languageName: node linkType: hard @@ -15695,16 +15699,16 @@ __metadata: languageName: node linkType: hard -"table@npm:^6.8.0, table@npm:^6.8.1": - version: 6.8.1 - resolution: "table@npm:6.8.1" +"table@npm:^6.8.0, table@npm:^6.8.1, table@npm:^6.8.2": + version: 6.8.2 + resolution: "table@npm:6.8.2" dependencies: ajv: "npm:^8.0.1" lodash.truncate: "npm:^4.4.2" slice-ansi: "npm:^4.0.0" string-width: "npm:^4.2.3" strip-ansi: "npm:^6.0.1" - checksum: 10/512c4f2bfb6f46f4d5ced19943ae5db1a5163eac1f23ce752625eb49715f84217c1c62bc2d017eb8985b37e0f85731108f654df809c0b34cca1678a672e7ea20 + checksum: 10/2946162eb87a91b9bf4283214d26830db96f09cf517eff18e7501d47a4770c529b432bb54c9394337c3dfd6c8dbf66581f76edb37e9838beb6ec394080af4ac2 languageName: node linkType: hard @@ -15807,10 +15811,10 @@ __metadata: languageName: node linkType: hard -"tildify@npm:2.0.0": - version: 2.0.0 - resolution: "tildify@npm:2.0.0" - checksum: 10/0f5fee93624c4afdf75ee224c3b65aece4817ba5317fd70f49eaf084ea720d73556a6ef3f50079425a773ba3b93805b4524d14057841d4e4336516fdbe80635b +"tildify@npm:3.0.0": + version: 3.0.0 + resolution: "tildify@npm:3.0.0" + checksum: 10/4d55c391f892bf10ebbcb867b876bc87912b9d4f54b0f60aae1c7924468943d61e15d8d246ac241d58d08c75621a0d585d0b3fc9cc2059534ac88807cb91d309 languageName: node linkType: hard @@ -16258,17 +16262,6 @@ __metadata: languageName: node linkType: hard -"typedoc-plugin-markdown@npm:^3.17.1": - version: 3.17.1 - resolution: "typedoc-plugin-markdown@npm:3.17.1" - dependencies: - handlebars: "npm:^4.7.7" - peerDependencies: - typedoc: ">=0.24.0" - checksum: 10/21bfe7fba60e3c27e15700196b1b4abdf5b63bfdc9a4af57cf6f0891f9d359ac561435773709c6ea3555bae402b7a81b637d055e767afd33e2c0dc717d0449d2 - languageName: node - linkType: hard - "typescript@npm:^5.3.3": version: 5.3.3 resolution: "typescript@npm:5.3.3" @@ -16583,9 +16576,9 @@ __metadata: languageName: node linkType: hard -"viem@npm:^2.9.26": - version: 2.9.27 - resolution: "viem@npm:2.9.27" +"viem@npm:^2.9.31": + version: 2.14.0 + resolution: "viem@npm:2.14.0" dependencies: "@adraffy/ens-normalize": "npm:1.10.0" "@noble/curves": "npm:1.2.0" @@ -16593,14 +16586,14 @@ __metadata: "@scure/bip32": "npm:1.3.2" "@scure/bip39": "npm:1.2.1" abitype: "npm:1.0.0" - isows: "npm:1.0.3" + isows: "npm:1.0.4" ws: "npm:8.13.0" peerDependencies: typescript: ">=5.0.4" peerDependenciesMeta: typescript: optional: true - checksum: 10/e4a1a16226cd9eacdefccae202f7ca8f25547980ecf2356dd71b200c50fc581f1d7ef978fc8f7a6d3e2dc37c0836e69249c3eb760c41c4b3fbb70f20f581822a + checksum: 10/04132cf4bcfbefd02e8fa1adf188e98f45b0af145302e3f897f924bec2d1b114c5050b5e643befa78b0aec42746033446fdff3bf63a262a0c30173443fc1094c languageName: node linkType: hard @@ -17279,9 +17272,9 @@ __metadata: languageName: node linkType: hard -"zod@npm:^3.22.4": - version: 3.22.4 - resolution: "zod@npm:3.22.4" - checksum: 10/73622ca36a916f785cf528fe612a884b3e0f183dbe6b33365a7d0fc92abdbedf7804c5e2bd8df0a278e1472106d46674281397a3dd800fa9031dc3429758c6ac +"zod@npm:^3.23.6": + version: 3.23.8 + resolution: "zod@npm:3.23.8" + checksum: 10/846fd73e1af0def79c19d510ea9e4a795544a67d5b34b7e1c4d0425bf6bfd1c719446d94cdfa1721c1987d891321d61f779e8236fde517dc0e524aa851a6eff1 languageName: node linkType: hard