-
Notifications
You must be signed in to change notification settings - Fork 9
Submitting proposal
Egor Lysenko edited this page Oct 10, 2020
·
1 revision
Any FTM token holder is allowed to submit a proposal. Each proposal submission will require a cost (called fee), which is a contract instant. Proposal fee will get burnt during the operation.
proposalFee
defines the fee amount.
Here's an example of creation of a proposal:
// Sanity check. Should return non-zero values.
proposalTemplates.get(yourProposalType);
// Artifacts of SoftwareUpgradeProposal
proposalAbi = JSON.parse('ABI_HERE');
proposalBin = '0xBYTECODE_HERE';
// Create new contract
// proposalTemplates.address is optional, replace with a zero address if proposal verification during deployment isn't needed.
// If proposalTemplates is specified, yhe deployment will revert if verification in proposalTemplates fails.
// proposalTemplates will not verify conctract bytecode in this call to reduce gas usage.
proposal = web3.ftm.contract(proposalAbi).new(proposal_parameters_here, proposalTemplates.address, { from: account, data: proposalBin });
// wait until transaction has confirmed and contract has received its address
proposal.address;
// Create proposal, burning 100 FTM during this operation
// The call will revert if proposal verification fails
gov.createProposal(proposal.address, {from: account, value: web3.toWei("100", "ftm")});
// Find your proposal ID
id = gov.lastProposalID();
// Ensure that id points to your proposal
gov.proposalParams(id);