Subscriptions

Status: Draft

Intro

Subscriptions contracts manage the on ramp to the platform, charging participants an amount of DAI, and letting them participate in the platform with fresh new P+ tokens. They work as a slightly modified version of an ERC1337, additionally issuing an amount of tokens to subscribers. They will be deeply interconnected with the cron contract, automatically identifying if a payment was done for a month, or another, thus moving the tokens to the competition bounty pool.

The Subscription contract has the ability to issue new P+ tokens every time it receives new subscription. In order to do that, the P+ token will delegate the issuance ability to this Smart Contract.

Subscription Contract

The subscription contract (open to public in v2) will enable users to subscribe Monthly to Helena, to have access to our prediction markets. The following simple generic interface will be used in order to subscribe to our contract:

contract ISubscription { 
    function subscribe(address _target, uint256 _amount) external;
    function execute(address _account) external returns (bool);
    function setTarget(address _account) external; // Connection to Issuer SC

    // Internal epoch counter (cron)
    function height() public view returns (uint256)

}

Where:

  • The subscribe function enable gives access (via approve) to the pool to take DAI every epoch

  • Execute is an external function called by our services to redirect DAI to the epoch Pool

  • setTarget : sets the target contract to be executed whenever the payment is received. In Helena, this will mean

Issuer Contract

This contract takes the ownership of the issue function on P+, creating fresh new tokens if a successful execution comes from the susbcription contract, and letting the user participate in the prediction markets for a month.

Last updated

Was this helpful?