1
0
tornado-governance/scripts/helper/propose_proposal.js

22 lines
688 B
JavaScript
Raw Permalink Normal View History

2023-05-21 20:02:21 +03:00
require('dotenv').config()
const { ethers } = require('hardhat')
async function propose(proposalArgs) {
const proposer = proposalArgs[0]
const ProposalContract = proposalArgs[1]
let GovernanceContract = await ethers.getContractAt(
'contracts/v1/Governance.sol:Governance',
'0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce',
)
GovernanceContract = GovernanceContract.connect(proposer)
2023-05-21 20:02:21 +03:00
const response = await GovernanceContract.propose(ProposalContract.address, proposalArgs[2])
const id = await GovernanceContract.latestProposalIds(proposer.address)
const state = await GovernanceContract.state(id)
return [response, id, state]
}
module.exports.propose = propose