I recently deployed a governor smart contract and now I'm trying to interact with it in js to create a proposal:
const governorAddress = "0xc9eCE0fE55bdA9c83d29aAD7796926e9171eba62"; //smart contract address of DAO
const governorAbi = require("../../contract_abis/MyGovernor.json");
const governor = new web3.eth.Contract(governorAbi.abi, governorAddress);
let proposalId = null;
const proposal_tx = await governor.methods
.propose(
[tokenAddress],
[0],
[transferCallData],
"Proposal #1: Give grant to team"
)
.call({ from: "0xEe45b8D2f99A8E12cBaFF2C6C8180B78D0586e6f" })
.then(async function (result: any) {
console.log("Finished creating proposal");
proposalId = result;
});
console.log(proposalId);
console.log(
await governor.methods
.state(proposalId)
.call({ from: "0xEe45b8D2f99A8E12cBaFF2C6C8180B78D0586e6f" })
);
When I execute this I am able to successfully get a proposal ID but when trying to get the state of the ID, I receive the following error
errors.js:28 Uncaught (in promise) Error: Returned error: execution reverted: Governor: unknown proposal id
I am working on the Ropsten testnet and don't see any transactions relevant to creating a proposal: https://ropsten.etherscan.io/address/0xc9eCE0fE55bdA9c83d29aAD7796926e9171eba62
What am I missing?