ODCdataManagersomnichainERC20

OmnichainUpgradeableERC20DataManager

Contract for managing an Upgradeable Omnichain ERC20 token using a Omnichain Fungible Token Data Object

_This contract is used to manage an Upgradeable Omnichain ERC20 token where a Data Object contract is used to store the token data on that chain.

 NOTE: This contract and the Data Object contract MUST be approved in the Data Index contract to interact with the given
 Data Point
 For the correct functioning of this contract, it must be registered as a handler in the Omnichain Fungible
 Fractions Data Object through the registerOmnichainIncreaseBalanceHandler function._

WrongParameters

error WrongParameters()

Error thrown when the parameters are wrong

NotRegisteredAsOmnichainIncreaseBalanceHandler

error NotRegisteredAsOmnichainIncreaseBalanceHandler()

Error thrown when the contract is not registered as an Omnichain Increase Balance handler

UnauthorizedCaller

error UnauthorizedCaller()

Error thrown when the caller is not the Fungible Token Data Object

datapoint

DataPoint datapoint

The Data Point identifier for the Omnichain Fungible Token Data Object

fungibleTokenDO

contract IDataObject fungibleTokenDO

The Omnichain Fungible Token Data Object

_isRegisteredAsOmnichainIncreaseBalanceHandler

bool _isRegisteredAsOmnichainIncreaseBalanceHandler

Variable to know if the contract is registered as an Omnichain Increase Balance handler

dataIndex

contract IDataIndex dataIndex

The Data Index implementation

constructor

constructor() public

initialize

function initialize(bytes32 dataPoint_, address dataIndex_, address dataObject_, string name_, string symbol_) external

__OmnichainUpgradeableERC20DataManager_init

function __OmnichainUpgradeableERC20DataManager_init(bytes32 dataPoint_, address dataIndex_, address dataObject_, string name_, string symbol_) internal

__OmnichainUpgradeableERC20DataManager_init_unchained

function __OmnichainUpgradeableERC20DataManager_init_unchained(bytes32 dataPoint_, address dataIndex_, address dataObject_) internal

registerOmnichainIncreaseBalanceHandler

function registerOmnichainIncreaseBalanceHandler() public

Function to register this contract as an omnichain increase balance handler NOTE: This function must be called after the contract is deployed

totalSupply

function totalSupply() public view returns (uint256)

Returns the value of tokens in existence.

balanceOf

function balanceOf(address account) public view returns (uint256)

Returns the value of tokens owned by account.

afterOmnichainFungibleTokenIncreaseBalanceOnTargetChain

function afterOmnichainFungibleTokenIncreaseBalanceOnTargetChain(OmnichainAddress from, address to, uint256 amount) external virtual returns (bool)

Function called after a token transfer on target chain

Parameters

NameTypeDescription
fromOmnichainAddressThe address from which the token was transferred
toaddressThe address to which the token was transferred
amountuint256The amount of the token transferred

Return Values

NameTypeDescription
[0]boolbool True if the callback was successful, false otherwise

_checkMinter

function _checkMinter() internal view

SHOULD throw an error if the sender is not allowed to mint

_writeSingleChainTransfer

function _writeSingleChainTransfer(address from, address to, uint256 amount) internal

_writeOmnichainTransfer

function _writeOmnichainTransfer(address from, OmnichainAddress to, uint256 amount, address payable refundAddress) internal

_msgSender

function _msgSender() internal view virtual returns (address)

_msgData

function _msgData() internal view virtual returns (bytes)

_contextSuffixLength

function _contextSuffixLength() internal view virtual returns (uint256)