-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-pin.ts
40 lines (33 loc) · 1.13 KB
/
setup-pin.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { ethers } from "hardhat";
// CONFIG
const pinAddress = "0x..."; // The address where the contract was deployed (proxy).
const fee = ethers.parseEther(""); // The amount of fees to collect from every minter.
enum GuildAction {
JOINED_GUILD,
IS_OWNER,
IS_ADMIN
}
const pinStrings = (action: GuildAction) => {
const actionNames = ["Joined", "Created", "Admin of"];
const descriptions = [
"This is an onchain proof that you joined",
"This is an onchain proof that you're the owner of",
"This is an onchain proof that you're an admin of"
];
return {
actionName: actionNames[action],
description: descriptions[action]
};
};
async function main() {
const GuildPin = await ethers.getContractFactory("GuildPin");
const pin = GuildPin.attach(pinAddress);
await pin.setFee(fee);
await pin.setPinStrings(GuildAction.JOINED_GUILD, pinStrings(GuildAction.JOINED_GUILD));
await pin.setPinStrings(GuildAction.IS_OWNER, pinStrings(GuildAction.IS_OWNER));
await pin.setPinStrings(GuildAction.IS_ADMIN, pinStrings(GuildAction.IS_ADMIN));
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});