RWA Technical
CrossChainMigrator
Key Methods
All migrate methods contain an extra parameter, `_airdropData`. This argument is used in the event the migrator wants to receive an airdrop of native ETH on the destination chain. For more info on how to use this param: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters
msg.value for each migrate method must not be 0. It is used to specify (and pay) an amount of gas for consumption on the destination chain. You can get a gas quote from `endpoint::estimateFees()`.
migrateNFT
function migrateNFT(uint256 _tokenId, address to, address payable refundAddress, address zroPaymentAddress, bytes calldata adapterParams) payable external;
Used to migrate a single PassiveIncome NFT from Polygon to Real chain. This method will take a user's PI NFT specified and send a message to the Polygon LayerZero endpoint to be later passed to the destination chain.
migrateNFTBatch
function migrateNFTBatch(uint256[] memory _tokenIds, address to, address payable refundAddress, address zroPaymentAddress, bytes calldata adapterParams) payable external;
This method is used to migrate a batch of PassiveIncome NFTs from Polygon to Real chain. This method will take a user's PI NFTs specified and send a message to the Polygon LayerZero endpoint to be later passed to the destination chain for a batch migration.
migrateTokens
function migrateTokens(uint256 _amountaddress to, address payable refundAddress, address zroPaymentAddress, bytes calldata adapterParams) payable external;
This method is used to migrate TNGBL tokens from Polygon to RWA on Real chain. This method will burn TNGBL tokens from the migrator then send a mintFor message to the RWA contract on Real chain.
RealReceiver
Key Methods
lzReceive
function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;
LayerZero endpoint will invoke this function to deliver the message on the destination.
RevenueDistributor
Key Methods
convertRewardToken
function convertRewardToken(address _token,uint256 _amount,address _target,bytes calldata _data) external;
Converts a specific revenue token to ETH and distributes it to the revenue stream.
convertRewardTokenBatch
function convertRewardTokenBatch(address[] memory _token,uint256[] memory _amount,address[] memory _target,bytes[] memory calldata _data) external;
Converts a batch of revenue tokens to ETH and distribute to the revenue stream.
addRevenueToken
function addRevenueToken(address _revToken) external;
This method is used to add a new supported revenue token.
removeRevenueToken
function removeRevenueToken(address _revToken) external;
This method is used to remove an existing revenue token.
setSelectorForTarget
function setSelectorForTarget(address _target, bytes4 _selector) external;
This method sets the verified function call for a `_target`.
Calldata cannot be used in conversion calls unless it’s added here.
distributeStreamETH
function distributeStreamETH() external;
This method distributes an ETH revenue stream to the RevenueStreamETH contract.
RevenueStreamETH
Key Methods
depositETH
function depositETH() payable external;
This method is used to deposit ETH into the contract to be claimed by shareholders.
claimETH
function claimETH(address account) external returns (uint256 amount);
This method allows eligible VE shareholders to claim their ETH revenue rewards by account.
claimable
function claimable(address account) external view returns (uint256 amount);
View method that returns an amount of ETH revenue that is claimable, given a specific `account`.
claimWithSignature
function claimWithSignature(uint256 amount, uint256 currentIndex, uint256 indexes, uint256 deadline, bytes calldata signature) external;
This method allows a user to perform a claim with data that has been verified via a signature from the dedicated signer
address.
How is the signature
generated?
The arguments given to the claimWithSignature
function must be verified and signed by our designated signer wallet before that data can be passed into the method. When a claim is initiated by a user, the function params are first obtained via the claimable
method and lastClaimIndex
. This data is then signed by our node and passed back to the application so the user can complete the claim with the verified arguments.
RWAVotingEscrow
Key Methods
mint
function mint(address _receiver, uint208 _lockedBalance, uint256 _duration) external returns (uint256 tokenId);
Mints a new VotingEscrow token representing a locked token position. The minting process locks a specified amount of tokens for a given vesting duration, assigning voting power accordingly.
migrate
function migrate(address _receiver, uint256 _lockedBalance, uint256 _duration) external returns (uint256 tokenId);
This method is called by the RealReceiverNFT contract to fulfill the cross-chain migration from 3,3+ to veRWA.
migrateBatch
function migrateBatch(address _receiver, uint256[] memory _lockedBalances, uint256[] memory _durations) external returns (uint256[] memory tokenIds);
This method is called by the RealReceiverNFT contract to fulfill the cross-chain migration of a batch of 3,3+ NFTs to veRWA NFTs.
burn
function burn(address receiver, uint256 tokenId) external;
Burns a VotingEscrow token, releasing the locked tokens to the specified receiver. The burning process can only be done once the vesting duration has finished.
If the lock duration remaining on lock is not 0, a penalty will be applied to the release of locked tokens.
merge
function merge(uint256 tokenId, uint256 intoTokenId) external;
Merges two VotingEscrow tokens into one, combining their locked balances and vesting durations. The merge process adjusts the voting power based on the new combined balance and vesting duration.
split
function split(uint256 tokenId, uint256[] calldata shares) external returns (uint256[] memory tokenIds);
Splits a VotingEscrow token into multiple tokens based on specified shares. The split process divides the locked balance and retains the original vesting duration for each new token.
getPastTotalVotingPower
function getPastTotalVotingPower(uint256 timepoint) external view returns (uint256);
Returns the most recent checkpoint (given a timestamp) for total voting power.
getPastVotingPower
function getPastVotingPower(uint256 tokenId, uint256 timepoint) external view returns (uint256);
Returns the most recent voting power checkpoint (given a timestamp) for a specific tokenId.
VotingEscrowVesting
Key Methods
deposit
function deposit(uint256 tokenId) external nonReentrant;
Deposits a VotingEscrow token to start it's vesting schedule. The function records the vesting schedule, removes the token's voting power, and transfers the token to this contract for vesting.
withdraw
function withdraw(address receiver, uint256 tokenId) external nonReentrant;
Withdraws a VotingEscrow token back to the depositor after the vesting period. The function restores the remaining vesting duration and transfers the token back to the depositor.
claim
function claim(address receiver, uint256 tokenId) external nonReentrant;
Claims the underlying locked tokens of a vested VotingEscrow token, effectively burning the VotingEscrow token. The function can only be called once the vesting period has completed.
If the remaining lock duration was not 0, will apply the early-burn penalty.
DelegateFactory
Key Methods
deployDelegator
function deployDelegator(uint256 _tokenId, address _delegatee, uint256 _duration) external returns (address newDelegator);
This method allows a permissioned address to create a delegator contract.
revokeExpiredDelegators
function revokeExpiredDelegators() external;
This method is used to fetch any expired Delegators, withdraw the delegated token from the Delegator, and delete its instance from the factory contract.
expiredDelegatorExists
function expiredDelegatorExists() external view returns (bool exists);
This view method is used to fetch whether there exists any expired delegators.
Delegator
Key Methods
depositDelegatorToken
function depositDelegatorToken(uint256 _tokenId) external;
This method is used to deposit a delegated veRWA NFT into this contract.
withdrawDelegatedToken
function withdrawDelegatedToken() external;
This method is used to transfer the `delegatedToken` back to the `creator`.
Last updated