-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement feature to disable invitation (#148)
* feat: implement feature to disable invitation * audit recommendation * add expiration * typo * update addresses * add pk
- Loading branch information
1 parent
d7f76a5
commit f79723b
Showing
11 changed files
with
214 additions
and
84 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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"zevm": { | ||
"zeta_testnet": { | ||
"disperse": "0xf394dc01879E39f19eDA533EFD10C82eEee5B2b1", | ||
"rewardDistributorFactory": "0x667e4C493d40015256BDC89E3ba750B2F90359E1", | ||
"zetaSwap": "0x44D1F1f9289DBA1Cf5824bd667184cEBE020aA1c", | ||
"zetaSwapBtcInbound": "0x008b393933D5CA2457Df570CA5D628380FFf6da4", | ||
"invitationManager": "0xF4cF881A3d23936e3710ef2Cbbe93f71C4389918" | ||
"disperse": "0x23ce409Ea60c3d75827d04D9db3d52F3af62e44d", | ||
"rewardDistributorFactory": "0xB9dc665610CF5109cE23aBBdaAc315B41FA094c1", | ||
"zetaSwap": "0xA8168Dc495Ed61E70f5c1941e2860050AB902cEF", | ||
"zetaSwapBtcInbound": "0x358E2cfC0E16444Ba7D3164Bbeeb6bEA7472c559", | ||
"invitationManager": "0x3649C03C472B698213926543456E9c21081e529d" | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; | ||
import { ethers } from "hardhat"; | ||
|
||
export const getInvitationSig = async (signer: SignerWithAddress) => { | ||
let payload = ethers.utils.defaultAbiCoder.encode(["address"], [signer.address]); | ||
export const getInvitationSig = async (signer: SignerWithAddress, expirationDate: number) => { | ||
const payload = ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [signer.address, expirationDate]); | ||
|
||
let payloadHash = ethers.utils.keccak256(payload); | ||
const payloadHash = ethers.utils.keccak256(payload); | ||
|
||
// This adds the message prefix | ||
let signature = await signer.signMessage(ethers.utils.arrayify(payloadHash)); | ||
const signature = await signer.signMessage(ethers.utils.arrayify(payloadHash)); | ||
return ethers.utils.splitSignature(signature); | ||
}; |
Oops, something went wrong.