Skip to content

Commit

Permalink
Merge pull request #31 from The-Poolz/multi-sender
Browse files Browse the repository at this point in the history
added new contract multiSender
  • Loading branch information
ashwinarora authored Nov 16, 2023
2 parents e1d53b5 + 1b41994 commit b0a6cb8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/contracts/configs/BinanceMain.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ export const BinanceMainChainConfig: TChainConfig = {
signUpAddress: "0x41b56bF3b21C53F6394a44A2ff84f1d2bBC27841",
poolzBackWithdraw: "0x7Ff9315f538dF7eC76Ec4815249Dd30519726460",
poolzTokenAddress: "0xbAeA9aBA1454DF334943951d51116aE342eAB255",
delayVault: { address: "0x5eb57B1210338b13E3D5572d5e1670285Aa71702", nameVersion: "[email protected]" }
delayVault: { address: "0x5eb57B1210338b13E3D5572d5e1670285Aa71702", nameVersion: "[email protected]" },
multiSender: {
address: "0x0759EdEd403B704dc8e76b4c73026782b58E0ED7",
nameVersion: "[email protected]"
}
}
4 changes: 4 additions & 0 deletions src/contracts/configs/BinanceTest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ export const BinanceTestChainConfig: TChainConfig = {
simpleRefundBuilder: {
address: "0x9c39a03459522185a1598D4ad2a9cCCCB0F5Ff8f",
nameVersion: "[email protected]"
},
multiSender: {
address: "0x2dAc629DbD97f248A3443E446fA93330aF773571",
nameVersion: "[email protected]"
}
}
12 changes: 11 additions & 1 deletion src/poolz/ThePoolz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ThePoolz implements IThePoolzInterface {
public refundProviderContract: IThePoolzInterface["refundProviderContract"]
public simpleBuilderContract: IThePoolzInterface["simpleBuilderContract"]
public simpleRefundBuilderContract: IThePoolzInterface["simpleRefundBuilderContract"]
public multiSenderContract: IThePoolzInterface["multiSenderContract"]

#provider: typeof Web3.givenProvider
#contracts = new Map<string, Contract>()
Expand Down Expand Up @@ -95,7 +96,8 @@ class ThePoolz implements IThePoolzInterface {
collateralProvider,
refundProvider,
simpleBuilder,
simpleRefundBuilder
simpleRefundBuilder,
multiSender
} = chainConfig

this.poolzTokenAddress = poolzTokenAddress
Expand Down Expand Up @@ -230,6 +232,14 @@ class ThePoolz implements IThePoolzInterface {
.catch(e => {console.error(e)})
);
}
if (multiSender) {
abifetchPromises.push(this.fetchContractAbi(multiSender.nameVersion)
.then(abi => {
this.multiSenderContract = { ...multiSender, contract: new this.web3.eth.Contract(abi as AbiItem[], multiSender.address) }
})
.catch(e => {console.error(e)})
);
}

try {
await Promise.allSettled(abifetchPromises)
Expand Down
2 changes: 2 additions & 0 deletions src/types/IThePoolzInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface IThePoolzInterface {
refundProviderContract?: IContractInfo
simpleBuilderContract?: IContractInfo
simpleRefundBuilderContract?: IContractInfo
multiSenderContract?: IContractInfo

getChaincoinInfo(k?: number): Promise<IChainInfo | undefined>
ERC20Balance(token: string, account: string): Promise<string>
Expand Down Expand Up @@ -124,6 +125,7 @@ export interface IChainConfig {
refundProvider: Omit<NonNullable<IThePoolzInterface["refundProviderContract"]>, "contract">
simpleBuilder: Omit<NonNullable<IThePoolzInterface["simpleBuilderContract"]>, "contract">
simpleRefundBuilder: Omit<NonNullable<IThePoolzInterface["simpleRefundBuilderContract"]>, "contract">
multiSender: Omit<NonNullable<IThePoolzInterface["multiSenderContract"]>, "contract">
}

export type TChainConfig = Partial<IChainConfig>

0 comments on commit b0a6cb8

Please sign in to comment.