creationRules and triggeringRules Example
As explained earlier in this section, the creationRules
and triggeringRules
contracts, representing key parts of governance rule-sets, are external contracts; they can be freely coded based on the needs of your organization.
On this page are some examples of creationRulesminate
and triggeringRules
contracts.
Note
Keep in mind that, for them to work correctly, the creationRulesminate
and triggeringRules
contracts must integrate the check
function of the IProposalChecker
interface, which is provided by the IProposalManager
interface.
If you don't need creationRules
and triggeringRules
you can pass them as address(0)
, in this way, everyone will be able to create and terminate Proposals.
creationRules
Contract n1- BySpecificAddress
:
BySpecificAddress
:This creationRules
contract can be used to define a specific wallet that can create Proposal through the batchCreate
function of the Proposal Manager.
The lazyInit initializes:
string
uri
-> represents the uri containing metadata of the contract.address
value
-> represents the address that can create Proposals.bool
discriminant
-> boolean value representing if the address value can be changed later using the setValue function (true) or not (false).
The setValue function can be called by the set value address to change the value address passing its power to the new value address. This function can be called only if the discriminant parameter is set as true.
No one besides the value address can create Proposals in the Proposal Manager.
triggeringRules
Coming soon
This is, of course, only an example of how creationRules
and triggeringRules
contracts can be used. Every project can create its own unique rules.
Last updated