Skip to content

Commit

Permalink
add propose
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbrg committed Feb 18, 2023
1 parent eaba81b commit 2335690
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions scripts/submit-proposal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// npx hardhat run scripts/submit-proposal.ts --network goerli
import hre, { ethers, network, artifacts } from 'hardhat'
const color = require("cli-color")

var msg = color.xterm(39).bgXterm(128)

async function main() {

console.log("\nSubmitting proposal...")

const TALLY_DAO_NAME = ""

const baseUrl = "https://www.tally.xyz/gov/"+TALLY_DAO_NAME+"/proposal/"
const govAbi = artifacts.readArtifactSync('Gov').abi

const [member] = await ethers.getSigners()
console.log("member:", member)

try {
// prepare Gov
const gov = new ethers.Contract( '0x690C775dD85365a0b288B30c338ca1E725abD50E', govAbi, member)

// prepare calldatas
const call = "0x"
const calldatas = [call.toString()]

// prepare proposal description
const PROPOSAL_DESCRIPTION = ""
console.log("PROPOSAL_DESCRIPTION:", PROPOSAL_DESCRIPTION)

// set targets and values
const targets = ["0xD8a394e7d7894bDF2C57139fF17e5CBAa29Dd977"] // Alice DAO Tester addr
const values = [ethers.utils.parseEther("0.0001")]

// call propose
const propose = await gov.propose(
targets,
values,
calldatas,
PROPOSAL_DESCRIPTION
)
console.log("Propose triggered")
const proposeReceipt = await propose.wait(1)
const proposalId = proposeReceipt.events![0].args!.proposalId.toString()
console.log("proposalId:", proposalId)
console.log("Tally link:", msg(baseUrl + proposalId))

} catch(e) {
console.log("error:", e)
}

}

main().catch((error) => {
console.error(error);
process.exitCode = 1;
});

0 comments on commit 2335690

Please sign in to comment.