Contract IMVDFunctionalityProposal

  • Path: contracts/IMVDFunctionalityProposal.sol
  • Version: 1
  • Title: Interface for Proposal

Proposals are the defacto heart of the protocol since they allow voting token holders potentially alter all of the logic of a DFO and even extend it via custom logic.

Methods

accept(uint256)

Vote to accept the Proposal, staking your voting tokens. Can be called only if the Proposal is still running.

disable()

Can be used by external Proposal Managers to disable not-yet started Surveys

getCodeName()

GET the Proposal Functionality string ID

getLocation()

GET address of the microservice

getMethodSignature()

GET the name of the microservice method to invoke

getProposer()

GET the address of the proposer

getProxy()

GET the Proxy address

getReplaces()

codeName of the microservice that will be replaced by this Proposal, can be blank.

getReturnAbiParametersArray()

GET the array of return values obtained from the called microservice's method

getSourceLocation()

GET the Location of the source code, saved in concatenated Base64 data chunks

getSourceLocationId()

GET the Base64 data chunk id of the corresponding Microservice

getSurveyDuration()

GET the duration of the Proposal in number of blocks

getSurveyEndBlock()

GET The proposal end block

getVote(address)

GET the current status of the voting of the given address

Params

  • addr: The address of the voter you want to know status

Returns

  • accept: Amount of YES votes
  • refuse: Amount of NO votes

getVotes()

Get the current votes status

Returns

  • _0: accept Amount of YES votes
  • _1: refuse Amount of NO votes

getVotesHardCapToReach()

GET the HardCap value

init(string,address,string,string,string,address)

Functionality Initializer

Params

  • codeName: ID of the microservice, to be called by the user through Proxy, can be blank.
  • location: Address of the functionality/microservice to call
  • methodSignature: Name of the method of the microservice you want to call
  • proxy: Address of the proxy
  • replaces: codeName of the microservice that will be replaced by this Proposal, can be blank.
  • returnAbiParametersArray: Array of return values obtained from the called microservice's method

isDisabled()

Check if a Proposal was canceled before its start

isEmergency()

GET the boolean flag indicating wether the Proposal is an Emergency Proposal

isInternal()

GET the boolean flag controlling wether the microservice can be called from anyone (false) or can be called only by other microservices (true)

isTerminated()

Check if the Proposal reached the natural time termination or the reachement of the Hard Cap.

isVotesHardCapReached()

Check that the HardCap has been reached

issubmittable()

GET the boolean flag controlling wether the microservice writes data to the chain

moveToAccept(uint256)

Move some "refuse" votes to "accept". Can be called only if the Proposal is still running.

moveToRefuse(uint256)

Move some "accept" votes to "refuse". Can be called only if the Proposal is still running.

needsSender()

GET the boolean flag controlling wether the original Proxy caller address should be forwarded or not

refuse(uint256)

Vote to refuse the Proposal, staking your voting tokens. Can be called only if the Proposal is still running.

retireAccept(uint256)

Retire your votes. Can be called only if the Proposal is still running.

retireAll()

Retire all your votes, retreiving back your staked voting tokens. Can be called only if the Proposal is still running.

retireRefuse(uint256)

Retire your votes. Can be called only if the Proposal is still running.

set()

Callable by the Proxy only. Marks this Proposal as definitively terminate. User can still call the withdrawAll() function to withdraw the tokens, of course.

setCollateralData(bool,address,uint256,bool,bool,bool,address,uint256)

set the collateral attributes of the proposal

Params

  • emergency: Bool flag controlling wether this is a standard or emergency proposal
  • isInternal: Boolean flag controlling wether the microservice can be called from anyone (false) or can be called only by other microservices (true)
  • needsSender: All microservices calls are made py the Proxy, with this boolean flag you can forward the address that called the Proxy in the first place
  • proposer: Address of the proposer
  • sourceLocation: Location of the source code, saved in concatenated Base64 data chunks
  • sourceLocationId: Base64 data chunk id of the corresponding Microservice
  • submittable: Boolean flag controlling wether the microservice writes data to the chain
  • votesHardCap: Hardcap value

start()

Can be used by external Proposal Managers to delay the Survey Start

terminate()

Force the Proposal to call the Proxy and execute the finalization operations. Can be called only if the Proposal reaches the Hard Cap or the final Block.

toJSON()

GET the json representation of the Functionality

withdraw()

Withdraw all the token you staked. Can be called only if the Proposal reaches the Hard Cap or the final Block.