4. Registration

Learn about registering your protected smart contracts

Contents

Intro

Since the CUBE3 RASP product blocks transactions on both off-chain and on-chain, your protected contracts must be registered on both:

  1. CUBE3 backend (with an HTTP request) for validation and cube3SecurePayload generation

  2. CUBE3 protocol (with a transaction to the CUBE3 Router) for decoding cube3SecurePayload and reverting transactions if they are malicious on-chain

See an example of how to register below:

Register with CUBE3 backend

To register your deployed contract (for more information about deployment, read here) head over to https://panorama.cube3.ai/rasp-pro where you will see the following:

Press Register your contract and you will be prompted with the following:

Input:

  1. A name for your contract

  2. Address of your deployed contract (for upgradeable contracts, input proxy address)

  3. Chain

Press Add contract.

Initially, your contractIntegration Status will be Pending until we detect your contract on-chain, eventually it will process and say Not Registered. Click on your contract to expand it:

Click Reveal Registration Token and save it somewhere, we will use it in the next step.

Registering with CUBE3 Router

To register your contract with CUBE3 Protocol on-chain, you will need to call registerIntegrationWithCube3 function on the CUBE3 router contract. You can find CUBE3 Router addresses for all supported chains here.

For simplicity, to interact with the CUBE3 router contract - we suggest you to use etherscan since all CUBE3 contracts are verified. For example, for sepolia - head over to https://sepolia.etherscan.io/address/0xB7a8c55aFe1B210ef37349574484CEdA2122D698#writeProxyContractand select registerIntegrationWithCube3. You will need to provide:

  • Your deployed contract address

  • Registration token (the one you saved on previous registration step)

  • Function selectors that you wish to protect (you will be able to disable protection later).

To generate function selectors simply run in your console:

cast sig "mintCube3Protected(address,uint256,bytes)"     //0xdfda26cd
cast sig "transferCube3Protected(address,uint256,bytes)" //0x11fb5122

Add necessary information and press Write. Make sure you do the transaction as the admin of the contract:

Registration on both CUBE3 backend and CUBE3 Protocol is now done.

Go back to your RASP dashboard and you will see Integration Status of your contract to Registered and function protection On. If you expand your contract you will be able to see function selectors that have protected.

At this point, you are finished and ready to do your first CUBE3 Protected transaction (read more here).

Last updated