<aside> đź‘‹ Functions allow program managers to issue points by manipulating contract events with more advanced custom logic - such as holding a token as a function of time, or getting more points for taking an action early (e.g. early minter). Functions can be written in javascript and built directly on Stack.so to make it easy to test and refine.
</aside>
<aside> âť“ To get the contract ABI for a contract on a block explorer like Etherscan or Basescan, click the contract tab and scroll to the Contract ABI section.
</aside>
<aside> âť“ Stack makes it easy to issue points from an event in a smart contract by automatically the parameters associated with it. You need to know the specific event you are looking for in a given smart contract, you can easily issue points.
For example, using the Base x Atari NFT contract, we can select the event GameMinted
which is emitted when a user mints the NFT.
Points Issuance | Expression |
---|---|
5 for minting | points: 5 |
5 per NFT minted | 5 * (endTokenId - startTokenId) |
</aside> |
Goal | Type | Event | Expression |
---|---|---|---|
Issue points as function of # of months subscribed | Hypersub Subscription | Purchase | timePurchased / 2592000 |