forked from paraswap/paraswap-dex-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generic-rfq: support smart contract wallet
Resolves BACK-874.
- Loading branch information
1 parent
12dbe50
commit d3d27a9
Showing
9 changed files
with
147 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
], | ||
"outputs": [ | ||
{ | ||
"type": "bool" | ||
"type": "bool", | ||
"name": "" | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Web3 from 'web3'; | ||
import type { Contract, ContractSendMethod } from 'web3-eth-contract'; | ||
import { AbiItem } from 'web3-utils'; | ||
import ERC1271ABI from '../abi/ERC1271.abi.json'; | ||
|
||
export interface ERC1271Contract extends Contract { | ||
methods: { | ||
isValidSignature( | ||
message: string, | ||
signature: string, | ||
): Omit<ContractSendMethod, 'call'> & { | ||
call: ( | ||
...params: Parameters<ContractSendMethod['call']> | ||
) => Promise<boolean>; | ||
}; | ||
}; | ||
} | ||
|
||
export const createERC1271Contract = ( | ||
web3: Web3, | ||
addr: string, | ||
): ERC1271Contract => { | ||
return new web3.eth.Contract(ERC1271ABI as AbiItem[], addr); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters