propose(contract, sender, proposalId, data, currency)

Feature

Returns raw operation that propose a new proposal. Note : Should match type of proposal and type of DAO service (the option value). The sender of proposeOperation should match with proposer of proposal. Only account in white list can execute.

Parameters

string contract address, string sender, string proposalId, // Must be a unique value within same dao service. object proposalData, string currency

Return Value

object proposeOperation

  • For creating 'Proposal data', see the 'writeCryptoProposal()' or 'writeBizProposal()' functions, depending on the purpose.

example

// make calldata
...

// make proposal
...

// make propose operation
const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const proposalID = "test_proposal"
const prposeOperation = mitum.dao.propose(contractAddress, sender, proposalID, cryptoProposal, currencyID);

console.log(prposeOperation);


// output
Operation {
  id: 'mitum',
  fact: ProposeFact {
    hint: Hint { s: 'mitum-dao-propose-operation-fact' },
    token: Token { s: '2023-10-17 07:20:29.23 +0000 UTC' },
    _hash: <Buffer aa db b8 8a ef b4 1f 3b 65 bf 83 47 b1 a9 07 fb 5a fb f4 e5 e0 8f 07 ef 94 41 cc f9 48 41 9e 05>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    proposalID: 'test_proposal',
    proposal: CryptoProposal {
      hint: [Hint],
      proposer: [Address],
      startTime: [Big],
      calldata: [TransferCalldata]
    }
  },
  hint: Hint { s: 'mitum-dao-propose-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated