From c15b15e149cda554b20633dae5e3aafb3e163408 Mon Sep 17 00:00:00 2001 From: sirpy Date: Sun, 4 Feb 2024 11:34:15 +0200 Subject: [PATCH] add: sdk beacon --- packages/contracts/releases/deployment.json | 257 ++++++++++++++++-- packages/sdk-js/scripts/createPool.ts | 8 +- packages/sdk-js/scripts/swapAndStream.ts | 31 +++ .../src/goodcollective/goodcollective.ts | 15 +- 4 files changed, 272 insertions(+), 39 deletions(-) create mode 100644 packages/sdk-js/scripts/swapAndStream.ts diff --git a/packages/contracts/releases/deployment.json b/packages/contracts/releases/deployment.json index e43f58ec..270c551d 100644 --- a/packages/contracts/releases/deployment.json +++ b/packages/contracts/releases/deployment.json @@ -5,7 +5,7 @@ "chainId": "31337", "contracts": { "DirectPaymentsFactory": { - "address": "0xf5059a5D33d5853360D16C683c16e67980206f36", + "address": "0xf953b3A269d80e3eB0F2947630Da976B896A8C5b", "abi": [ { "anonymous": false, @@ -141,6 +141,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "indexed": false, @@ -380,6 +385,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "internalType": "struct DirectPaymentsPool.PoolSettings", @@ -468,6 +478,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "internalType": "struct DirectPaymentsPool.PoolSettings", @@ -882,7 +897,7 @@ ] }, "DirectPaymentsFactory_Implementation": { - "address": "0x851356ae760d987E095750cCeb3bC6014560891C", + "address": "0xA4899D35897033b927acFCf422bc745916139776", "abi": [ { "inputs": [], @@ -997,6 +1012,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "indexed": false, @@ -1249,6 +1269,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "internalType": "struct DirectPaymentsPool.PoolSettings", @@ -1337,6 +1362,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "internalType": "struct DirectPaymentsPool.PoolSettings", @@ -1735,7 +1765,7 @@ ] }, "DirectPaymentsFactory_Proxy": { - "address": "0xf5059a5D33d5853360D16C683c16e67980206f36", + "address": "0xf953b3A269d80e3eB0F2947630Da976B896A8C5b", "abi": [ { "inputs": [ @@ -1809,7 +1839,7 @@ ] }, "DirectPaymentsPool": { - "address": "0x9E545E3C0baAB3E08CdfD552C960A1050f373042", + "address": "0x49fd2BE640DB2910c2fAb69bB8531Ab6E76127ff", "abi": [ { "inputs": [ @@ -2147,6 +2177,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "indexed": false, @@ -2250,6 +2285,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "indexed": false, @@ -2800,6 +2840,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -2996,7 +3041,7 @@ "type": "bytes" } ], - "internalType": "struct SwapLibrary.SwapData", + "internalType": "struct HelperLibrary.SwapData", "name": "_customData", "type": "tuple" }, @@ -3102,6 +3147,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "internalType": "struct DirectPaymentsPool.PoolSettings", @@ -3272,6 +3322,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -3500,6 +3555,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "internalType": "struct DirectPaymentsPool.PoolSettings", @@ -3540,6 +3600,11 @@ "internalType": "contract IERC20Upgradeable", "name": "rewardToken", "type": "address" + }, + { + "internalType": "bool", + "name": "allowRewardOverride", + "type": "bool" } ], "stateMutability": "view", @@ -3728,7 +3793,7 @@ ] }, "GoodDollar": { - "address": "0x09635F643e140090A9A8Dcd712eD6285858ceBef", + "address": "0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d", "abi": [ "constructor(address _host)", "error SF_TOKEN_AGREEMENT_ALREADY_EXISTS()", @@ -3743,8 +3808,10 @@ "error SUPER_TOKEN_CALLER_IS_NOT_OPERATOR_FOR_HOLDER()", "error SUPER_TOKEN_INFLATIONARY_DEFLATIONARY_NOT_SUPPORTED()", "error SUPER_TOKEN_MINT_TO_ZERO_ADDRESS()", + "error SUPER_TOKEN_NFT_PROXY_ALREADY_SET()", "error SUPER_TOKEN_NOT_ERC777_TOKENS_RECIPIENT()", "error SUPER_TOKEN_NO_UNDERLYING_TOKEN()", + "error SUPER_TOKEN_ONLY_GOV_OWNER()", "error SUPER_TOKEN_ONLY_HOST()", "error SUPER_TOKEN_ONLY_SELF()", "error SUPER_TOKEN_TRANSFER_FROM_ZERO_ADDRESS()", @@ -3761,6 +3828,8 @@ "event Bailout(address indexed bailoutAccount, uint256 bailoutAmount)", "event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData)", "event CodeUpdated(bytes32 uuid, address codeAddress)", + "event ConstantInflowNFTCreated(address indexed constantInflowNFT)", + "event ConstantOutflowNFTCreated(address indexed constantOutflowNFT)", "event Initialized(uint8 version)", "event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData)", "event Paused(address account)", @@ -3769,12 +3838,12 @@ "event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)", "event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)", "event Sent(address indexed operator, address indexed from, address indexed to, uint256 amount, bytes data, bytes operatorData)", - "event TokenDowngraded(address indexed account, uint256 amount)", - "event TokenUpgraded(address indexed account, uint256 amount)", "event Transfer(address indexed from, address indexed to, uint256 value, bytes data)", "event Transfer(address indexed from, address indexed to, uint256 value)", "event TransferFee(address from, address to, uint256 amount, uint256 fee, bool senderPays)", "event Unpaused(address account)", + "function CONSTANT_INFLOW_NFT() view returns (address)", + "function CONSTANT_OUTFLOW_NFT() view returns (address)", "function DEFAULT_ADMIN_ROLE() view returns (bytes32)", "function DOMAIN_SEPARATOR() view returns (bytes32)", "function MINTER_ROLE() view returns (bytes32)", @@ -3791,11 +3860,12 @@ "function cap() view returns (uint256)", "function castrate()", "function createAgreement(bytes32 id, bytes32[] data)", + "function creditGasFees(address from, address feeRecipient, address gatewayFeeRecipient, address baseFeeRecipient, uint256 refund, uint256 tipTxFee, uint256 gatewayFee, uint256 baseTxFee)", + "function debitGasFees(address from, uint256 value)", "function decimals() pure returns (uint8)", "function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool)", "function defaultOperators() view returns (address[])", "function disableHostOperations() view returns (bool)", - "function downgrade(uint256 amount)", "function enableHostOperations(bool enabled)", "function feeRecipient() view returns (address)", "function formula() view returns (address)", @@ -3816,7 +3886,7 @@ "function identity() view returns (address)", "function increaseAllowance(address spender, uint256 addedValue) returns (bool)", "function initialize(address underlyingToken, uint8 underlyingDecimals, string n, string s)", - "function initialize(string n, string s, uint256 _cap, address _formula, address _identity, address _feeRecipient, address _owner)", + "function initialize(string n, string s, uint256 _cap, address _formula, address _identity, address _feeRecipient, address _owner, address _outflowNFT, address _inflowNFT)", "function isAccountCritical(address account, uint256 timestamp) view returns (bool isCritical)", "function isAccountCriticalNow(address account) view returns (bool isCritical)", "function isAccountSolvent(address account, uint256 timestamp) view returns (bool isSolvent)", @@ -3829,15 +3899,18 @@ "function name() view returns (string)", "function nonces(address owner) view returns (uint256)", "function operationApprove(address account, address spender, uint256 amount)", - "function operationDowngrade(address account, uint256 amount)", + "function operationDecreaseAllowance(address account, address spender, uint256 subtractedValue)", + "function operationIncreaseAllowance(address account, address spender, uint256 addedValue)", + "function operationSend(address spender, address recipient, uint256 amount, bytes userData)", "function operationTransferFrom(address account, address spender, address recipient, uint256 amount)", - "function operationUpgrade(address account, uint256 amount)", "function operatorBurn(address account, uint256 amount, bytes data, bytes operatorData)", "function operatorSend(address sender, address recipient, uint256 amount, bytes data, bytes operatorData)", "function owner() view returns (address)", "function pause()", "function paused() view returns (bool)", "function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)", + "function poolAdminNFT() view returns (address)", + "function poolMemberNFT() view returns (address)", "function proxiableUUID() pure returns (bytes32)", "function realtimeBalanceOf(address account, uint256 timestamp) view returns (int256 availableBalance, uint256 deposit, uint256 owedDeposit)", "function realtimeBalanceOfNow(address account) view returns (int256 availableBalance, uint256 deposit, uint256 owedDeposit, uint256 timestamp)", @@ -3846,33 +3919,99 @@ "function revokeOperator(address operator)", "function revokeRole(bytes32 role, address account)", "function selfApproveFor(address account, address spender, uint256 amount)", - "function selfBurn(address account, uint256 amount, bytes userData)", - "function selfMint(address account, uint256 amount, bytes userData)", - "function selfTransferFrom(address holder, address spender, address recipient, uint256 amount)", "function send(address recipient, uint256 amount, bytes data)", "function setFeeRecipient(address _feeRecipient)", "function setFormula(address _formula)", "function setIdentity(address _identity)", + "function setNFTProxyContracts(address _constantOutflowNFT, address _constantInflowNFT, address _poolAdminNFT, address _poolMemberNFT)", "function settleBalance(address account, int256 delta)", "function supportsInterface(bytes4 interfaceId) view returns (bool)", "function symbol() view returns (string)", "function terminateAgreement(bytes32 id, uint256 dataLength)", "function totalSupply() view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)", - "function transferAll(address recipient)", "function transferAndCall(address to, uint256 amount, bytes data) returns (bool)", "function transferFrom(address holder, address recipient, uint256 amount) returns (bool)", "function transferOwnership(address _owner)", "function unpause()", "function updateAgreementData(bytes32 id, bytes32[] data)", "function updateAgreementStateSlot(address account, uint256 slotId, bytes32[] slotData)", - "function updateCode(address newAddress)", - "function upgrade(uint256 amount)", - "function upgradeTo(address to, uint256 amount, bytes data)" + "function updateCode(address newAddress)" + ] + }, + "HelperLibrary": { + "address": "0x7A9Ec1d04904907De0ED7b6839CcdD59c3716AC9", + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "netIncome", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFees", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastUpdate", + "type": "uint256" + }, + { + "internalType": "address", + "name": "lastFeeRecipient", + "type": "address" + }, + { + "internalType": "int96", + "name": "lastIncomeRate", + "type": "int96" + } + ], + "internalType": "struct IGoodCollectiveSuperApp.Stats", + "name": "stats", + "type": "tuple" + }, + { + "internalType": "contract ISuperToken", + "name": "superToken", + "type": "ISuperToken" + } + ], + "name": "getRealtimeStats", + "outputs": [ + { + "internalType": "uint256", + "name": "netIncome", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFees", + "type": "uint256" + }, + { + "internalType": "int96", + "name": "incomeFlowRate", + "type": "int96" + }, + { + "internalType": "int96", + "name": "feeRate", + "type": "int96" + } + ], + "stateMutability": "view", + "type": "function" + } ] }, "ProvableNFT": { - "address": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8", + "address": "0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D", "abi": [ { "anonymous": false, @@ -4324,6 +4463,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -4380,6 +4524,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData", @@ -4426,6 +4575,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -4618,6 +4772,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -4733,6 +4892,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -4790,6 +4954,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -5047,7 +5216,7 @@ ] }, "ProvableNFT_Implementation": { - "address": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9", + "address": "0x4631BCAbD6dF18D94796344963cB60d44a4136b6", "abi": [ { "inputs": [ @@ -5491,6 +5660,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -5547,6 +5721,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData", @@ -5593,6 +5772,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -5785,6 +5969,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -5900,6 +6089,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -5957,6 +6151,11 @@ "internalType": "address[]", "name": "contributers", "type": "address[]" + }, + { + "internalType": "uint128", + "name": "rewardOverride", + "type": "uint128" } ], "internalType": "struct ProvableNFT.EventData[]", @@ -6198,7 +6397,7 @@ ] }, "ProvableNFT_Proxy": { - "address": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8", + "address": "0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D", "abi": [ { "inputs": [ @@ -6272,11 +6471,11 @@ ] }, "SuperFluidResolver": { - "address": "0x41549B6C39A529EA574f35b745b00f716869D2a0", + "address": "0x67413011D683714fB4a15b3389fbf9E6457ee1F6", "abi": [] }, "SwapRouterMock": { - "address": "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E", + "address": "0x1c85638e118b37167e9298c2268758e058DdfDA0", "abi": [ { "inputs": [ @@ -7299,7 +7498,7 @@ ] }, "DirectPaymentsFactory_Implementation": { - "address": "0xfF6F1C470e19FA3486f825DBFDc72af529b31A2c", + "address": "0xBc1d6cDB7Bc2BFF1091A3db1CCCc4506EBb6d466", "abi": [ { "inputs": [], @@ -8241,7 +8440,7 @@ ] }, "DirectPaymentsPool": { - "address": "0xc70B7dc0C960e9303E57daA9fee23727e9C0A176", + "address": "0xB8cc664aC448dBd6a16247849a454F1D0a7448Bc", "abi": [ { "inputs": [ @@ -8251,7 +8450,7 @@ "type": "address" }, { - "internalType": "contract ISwapRouter", + "internalType": "contract IV3SwapRouter", "name": "_swapRouter", "type": "address" } @@ -10140,7 +10339,7 @@ "name": "swapRouter", "outputs": [ { - "internalType": "contract ISwapRouter", + "internalType": "contract IV3SwapRouter", "name": "", "type": "address" } @@ -10195,7 +10394,7 @@ ] }, "HelperLibrary": { - "address": "0x15a3a0Fb7d3C91806a5379A463AdaE0427Fce2BB", + "address": "0xE5a388DF47839BbC6227f52FB622DeB523079Aa8", "abi": [ { "inputs": [ diff --git a/packages/sdk-js/scripts/createPool.ts b/packages/sdk-js/scripts/createPool.ts index 1bf33ad7..7e980148 100644 --- a/packages/sdk-js/scripts/createPool.ts +++ b/packages/sdk-js/scripts/createPool.ts @@ -10,9 +10,9 @@ const wallet = new ethers.Wallet(process.env.PRIVATE_KEY || '').connect(provider const sdk = new GoodCollectiveSDK('42220', provider, { nftStorageKey: process.env.VITE_NFTSTORAGE_KEY }); const main = async () => { - const projectId = 'silvi'; + const projectId = 'gc'; const poolAttributes = { - name: 'Silvi Test With Max (Real G$)', + name: 'Beacon Fixed Swap Test (Real G$)', description: 'This Collective directly supports smallholder farmers around Kenya’s Kakamega forest. These farmers are acting as nurseries, growing and nurturing native trees to maturity for subsequent reforestation. In partnership with Silvi.', email: 'myemail@gmail.com', @@ -32,7 +32,7 @@ const main = async () => { const poolSettings = { validEvents: [1, 2], rewardPerEvent: [ethers.constants.WeiPerEther.mul(1), ethers.constants.WeiPerEther.mul(2)], - manager: '0xEbB3341cD1511035845f1b37e6A2BFCDcf433Ad7', + manager: wallet.address, membersValidator: ethers.constants.AddressZero, uniquenessValidator: ethers.constants.AddressZero, rewardToken: '0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A', //celo production token @@ -45,7 +45,7 @@ const main = async () => { maxMemberPerDay: ethers.constants.WeiPerEther.mul(5), }; - const pool = await sdk.createPoolWithAttributes(wallet, projectId, poolAttributes, poolSettings, poolLimits); + const pool = await sdk.createPoolWithAttributes(wallet, projectId, poolAttributes, poolSettings, poolLimits, true); console.log(pool.address); }; diff --git a/packages/sdk-js/scripts/swapAndStream.ts b/packages/sdk-js/scripts/swapAndStream.ts new file mode 100644 index 00000000..d8bc751c --- /dev/null +++ b/packages/sdk-js/scripts/swapAndStream.ts @@ -0,0 +1,31 @@ +// Run with npx ts-node --esm +import * as ethers from 'ethers'; +import { GoodCollectiveSDK } from '../src/goodcollective/goodcollective'; +import { config } from 'dotenv'; + +config(); +// const provider = new ethers.providers.JsonRpcProvider('https://alfajores-forno.celo-testnet.org'); +const provider = new ethers.providers.JsonRpcProvider('https://forno.celo.org'); +const wallet = new ethers.Wallet(process.env.PRIVATE_KEY || '').connect(provider); +const sdk = new GoodCollectiveSDK('42220', provider, { nftStorageKey: process.env.VITE_NFTSTORAGE_KEY }); +console.log(wallet.address); +const main = async () => { + const swap = { + swapFrom: '0x471EcE3750Da237f93B8E339c536989b8978a438', + amount: ethers.utils.parseEther('0.1'), + minReturn: 0, + deadline: (Date.now() / 1000).toFixed(0) + 6000000, + path: '0x', + }; + + const tx = await sdk.supportFlowWithSwap( + wallet, + '0x11f18e8f2a27d54a605cf10486b3d4c5aeeba81f', + ethers.utils.parseEther('0.0000001').toString(), + swap + ); + const res = await tx.wait().catch(console.log); + console.log(res); +}; + +main(); diff --git a/packages/sdk-js/src/goodcollective/goodcollective.ts b/packages/sdk-js/src/goodcollective/goodcollective.ts index d8323cf8..ea924c74 100644 --- a/packages/sdk-js/src/goodcollective/goodcollective.ts +++ b/packages/sdk-js/src/goodcollective/goodcollective.ts @@ -146,10 +146,11 @@ export class GoodCollectiveSDK { projectId: string, poolAttributes: PoolAttributes, poolSettings: PoolSettings, - poolLimits: PoolLimits + poolLimits: PoolLimits, + isBeacon: boolean ) { const uri = await this.savePoolToIPFS(poolAttributes); - return this.createPool(signer, projectId, uri, poolSettings, poolLimits); + return this.createPool(signer, projectId, uri, poolSettings, poolLimits, isBeacon); } /** @@ -166,13 +167,15 @@ export class GoodCollectiveSDK { projectId: string, poolIpfs: string, poolSettings: PoolSettings, - poolLimits: PoolLimits + poolLimits: PoolLimits, + isBeacon: boolean ) { poolSettings.nftType = 0; // force some type, this will be re-assigned by the factory + const createMethod = isBeacon + ? this.factory.connect(signer).createBeaconPool + : this.factory.connect(signer).createPool; const tx = await ( - await this.factory - .connect(signer) - .createPool(projectId, poolIpfs, poolSettings as DirectPaymentsPool.PoolSettingsStruct, poolLimits) + await createMethod(projectId, poolIpfs, poolSettings as DirectPaymentsPool.PoolSettingsStruct, poolLimits) ).wait(); const created = tx.events?.find((_) => _.event === 'PoolCreated'); return this.pool.attach(created?.args?.[0]);