-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add mint/burn from admin pod functions
- Loading branch information
Will Kim
committed
May 10, 2022
1 parent
d491ab1
commit 666c9f2
Showing
6 changed files
with
262 additions
and
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { getPod } from '../src'; | ||
import { adminPodAddress, dummyAccount, subPodAddress } from '../env.json'; | ||
import { setup, sleep } from './utils'; | ||
|
||
async function main() { | ||
const { walletOne, walletTwo } = setup(); | ||
|
||
// Get the pod we're working with | ||
|
||
const adminPod = await getPod(adminPodAddress); | ||
const subPod = await getPod(subPodAddress) | ||
|
||
if ((await adminPod.getProposals({ queued: true }))[0].status !== 'executed') { | ||
throw new Error( | ||
'Super pod had an active/queued transaction. This script expects no enqueued transactions', | ||
); | ||
} | ||
|
||
console.log('subPod.admin', subPod.admin); | ||
|
||
// We mint/burn the dummy account based on whether its a member or not. | ||
const isMember = await subPod.isMember(dummyAccount); | ||
if (isMember) { | ||
await subPod.burnMemberFromAdminPod(adminPod, dummyAccount, walletOne); | ||
} else { | ||
await subPod.mintMemberFromAdminPod(adminPod, dummyAccount, walletOne); | ||
} | ||
|
||
const proposal = (await adminPod.getProposals())[0]; | ||
|
||
await proposal.approve(walletTwo); | ||
await proposal.executeApprove(walletTwo); | ||
|
||
// // Let gnosis catch up. | ||
// await sleep(5000); | ||
|
||
// if (proposal.status !== 'executed') throw new Error('Proposal status not right'); | ||
// const refetchProposal = (await adminPod.getProposals())[0]; | ||
// if (!refetchProposal.safeTransaction.isExecuted) | ||
// throw new Error('Proposal not executed according to gnosis'); | ||
} | ||
|
||
main(); |
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
Oops, something went wrong.