Royco
  • Overview
    • Introduction to Royco
    • Key Concepts
    • Applications
  • FOR USERS
    • FAQs
    • How to Use Royco
  • FOR INCENTIVE PROVIDERS
    • Developer Overview
      • Fees on Royco
    • Recipes vs. Vaults IAMs
    • Create an IAM
    • Incentivize IAMs
      • Types of Incentives
      • Place an Incentive Offer
      • Place an Incentive Offer: For Developers
      • Setup a Points Campaign
      • Native Yield
    • Verify a Market
    • Audits
    • Contract Addresses
  • MORE
    • Bug Bounty Program
    • Cross-Chain Deposit Module (CCDM)
      • CCDM Recipe IAMs
      • Deposit Locker
      • Deposit Executor
      • Token Support
      • Audits
      • IP Guide
    • Royco V2
      • Incentive Locker
      • Action Verifiers
      • Multiplier Market Hub
      • Audit
    • Royco SDK
    • Contributing to the Protocol
    • Brand Kit
  • Royco Vaults
    • Royco Vaults: Overview
  • Royco Vaults: Risks
Powered by GitBook
On this page
  1. FOR INCENTIVE PROVIDERS
  2. Incentivize IAMs

Setup a Points Campaign

PreviousPlace an Incentive Offer: For DevelopersNextNative Yield

Last updated 2 months ago

Royco points programs are smart contracts which can be slotted in anywhere the Royco protocol expects an ERC20 to be distributed as incentives. Unlike an ERC20 however, Royco Points Programs cannot be transferred, balances cannot be queried onchain, and the contract has no state, making it difficult to tokenize by an external party. Royco Points Programs simply award points via emitting events via a function that can only be called by Royco contracts, and only by allowed vault market vaults, or recipe market IPs.

  1. Go to the PointsFactory contract on etherscan or the block explorer of the chain of your choice. All PointsFactories are deployed to 0x19112AdBDAfB465ddF0b57eCC07E68110Ad09c50

  2. Navigate to the Write Contract page and deploy a Points contract, choosing values for the following Params:

    1. _name: the name of your points program, which will be displayed on the Royco frontend

    2. _symbol: the “ticker” of your points program, same as an ERC20 symbol

    3. _decimals: Like an ERC20, 18 recommended

    4. _owner: The address with admin privileges over the points program, allowed to add new IPs and Vaults permitted to award points. Ownership can be transferred.

  1. After clicking ‘Write’, and confirming the transaction, click “View your transaction” and navigate to the “Internal Txns” tab. Find your new points contract in the create2 call. (The new contract can also be found in the transaction logs.) The new points contract should already be verified but if for whatever reason it is not, please reach out to @corddry on telegram

  1. Verify the vaults/IPs that you want to allow to award points

  1. If you have a vault market that you want to distribute points through, get the wrapped vault address (make sure to get the wrapped vault not the underlying vault!) and call the addAllowedVault function with it as a parameter

  2. If you have a recipe market that you want to distribute points through, get the address of the account that you want to act as the Incentive Provider on Royco, and pass it to the addAllowedIP function

  3. Note that multiple vaults and IPs may be added, but they cannot be removed. Your points program is now fully functional!

How to add your points program to the Royco frontend

To add the points program to the Royco frontend, make a PR to the royco-sdk repository which adds your points program.

  1. Determine the chainID of the chain you deployed your points contract on

    1. See https://chainlist.org/. Examples:

      1. Ethereum Mainnet: 1

      2. Base: 8453

      3. Arbitrum One: 42161

      4. Corn: 21000000

      5. Plume: 98865

      6. Sonic: 146

  2. Find the token-map with the corresponding chainID, for example token-map-42161.tsx for Arbitrum

    1. Chain ID: Chain ID (in this, case 11155111), followed by a dash, followed by the Points contract address.

    2. id should be the same chain_id

    3. contract_address should be same contract address from earlier

    4. contract_address should be the Points contract address

    5. name should be the exact same name you passed in when creating the contract from the factory

    6. symbol should also mirror the value passed to the factory

    7. image should be a link to the icon you wish to use, ideally a square image of size 512px*512px, preferably an svg, then png, then jpeg.

    8. decimals should mirror the value passed in when creating the contract from the factory

    9. type should be “point”

  3. Now submit the changes as a PR, and wait for review

Once your PR is accepted your points program will be available as an incentive asset on the Royco frontend! Freely add incentives on Royco using this asset, and Award events will be emitted. Later an offchain script can index these Award events to calculate the number of points a user has earned on Royco.

Navigate to

Add a config for your points contract at the bottom of the file, but before the final closing bracket, following the following example pattern: (note this can be done directly in Github by clicking the pencil icon in the top right) Add a config for your points inside the definition directory with the file name [chainid]-[token_contract_address_in_lowercase].ts Example:

https://github.com/roycoprotocol/royco-sdk/tree/main/sdk/constants/token-map
https://github.com/roycoprotocol/royco-sdk/blob/601131c94b0eb9798e4a70dd4813a521c3[…]initions/11155111-0xa43531c348db1bdde82d963b387d21cd344bf698.ts