2 txs
3 calls
constructor
constructor()
functions
DEFAULT_ADMIN_ROLE
viewfunction DEFAULT_ADMIN_ROLE() view returns (bytes32)
DENOMINATOR
viewfunction DENOMINATOR() view returns (uint256)
getBasePrice
viewfunction getBasePrice(uint256 poolId) view returns (uint256)
getCurrentPrice
viewfunction getCurrentPrice(uint256 poolId) view returns (uint256)
getCurrentPriceAndDecimals
viewfunction getCurrentPriceAndDecimals(uint256 poolId) view returns (uint256 price, uint8 decimals)
getCurrentPriceDeviationStatus
viewfunction getCurrentPriceDeviationStatus(uint256 poolId) view returns (uint8)
getPriceFeedAddress
viewfunction getPriceFeedAddress(uint256 poolId) view returns (address)
getPriceFeedDecimals
viewfunction getPriceFeedDecimals(uint256 poolId) view returns (uint8)
getRoleAdmin
viewfunction getRoleAdmin(bytes32 role) view returns (bytes32)
getValidityPeriod
viewfunction getValidityPeriod(uint256 poolId) view returns (uint256)
hasRole
viewfunction hasRole(bytes32 role, address account) view returns (bool)
ONE_BPS_PRICE_CHANGE_THRESHOLD
viewfunction ONE_BPS_PRICE_CHANGE_THRESHOLD() view returns (uint256)
ONE_BPS
viewfunction ONE_BPS() view returns (uint256)
priceDepegThreshold
viewfunction priceDepegThreshold() view returns (uint256)
priceDriftThreshold
viewfunction priceDriftThreshold() view returns (uint256)
priceNeedsUpdate
viewfunction priceNeedsUpdate(uint256 poolId) view returns (bool, uint256)
supportsInterface
viewfunction supportsInterface(bytes4 interfaceId) view returns (bool)
TEN_BPS_PRICE_CHANGE_THRESHOLD
viewfunction TEN_BPS_PRICE_CHANGE_THRESHOLD() view returns (uint256)
grantRole
nonpayablefunction grantRole(bytes32 role, address account)
renounceRole
nonpayablefunction renounceRole(bytes32 role, address callerConfirmation)
revokeRole
nonpayablefunction revokeRole(bytes32 role, address account)
setBasePriceAndFeedAddress
nonpayablefunction setBasePriceAndFeedAddress(uint256 poolId, uint256 basePrice, address priceFeedAddress, uint256 validityPeriodSeconds)
setPriceDepegThreshold
nonpayablefunction setPriceDepegThreshold(uint256 priceDepegThreshold_)
setPriceDriftThreshold
nonpayablefunction setPriceDriftThreshold(uint256 priceDriftThreshold_)
setValidityPeriodSeconds
nonpayablefunction setValidityPeriodSeconds(uint256 poolId, uint256 validityPeriodSeconds)
updateCurrentPrice
nonpayablefunction updateCurrentPrice(uint256 poolId, bool forceUpdate)
events
PoolStateUpdated
event PoolStateUpdated(uint256 indexed poolId, uint256 basePrice, address priceFeedAddress, uint256 validityPeriod)
PriceDepegThresholdUpdated
event PriceDepegThresholdUpdated(uint256 priceDepegThreshold)
PriceDriftThresholdUpdated
event PriceDriftThresholdUpdated(uint256 priceDriftThreshold)
PriceUpdated
event PriceUpdated(uint256 indexed poolId, uint256 price)
RoleAdminChanged
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
RoleGranted
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
RoleRevoked
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
ValidityPeriodUpdated
event ValidityPeriodUpdated(uint256 indexed poolId, uint256 priceValidityPeriod)
errors
AccessControlBadConfirmation
error AccessControlBadConfirmation()
AccessControlUnauthorizedAccount
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)
TokiCannotCloseChannel
error TokiCannotCloseChannel()
TokiCannotTimeoutPacket
error TokiCannotTimeoutPacket()
TokiChannelNotFound
error TokiChannelNotFound(string portId, string channelId)
TokiContractNotAllowed
error TokiContractNotAllowed(string name, address addr)
TokiDepeg
error TokiDepeg(uint256 poolId)
TokiDstChainIdNotAccepted
error TokiDstChainIdNotAccepted(uint256 dstChainId)
TokiDstOuterGasShouldBeZero
error TokiDstOuterGasShouldBeZero()
TokiExceed
error TokiExceed(string name, uint256 value, uint256 limit)
TokiExceedAdd
error TokiExceedAdd(string name, uint256 current, uint256 add, uint256 limit)
TokiFailToRefund
error TokiFailToRefund()
TokiFallbackUnauthorized
error TokiFallbackUnauthorized(address caller)
TokiFlowRateLimitExceed
error TokiFlowRateLimitExceed(uint256 current, uint256 add, uint256 limit)
TokiInsufficientAmount
error TokiInsufficientAmount(string name, uint256 value, uint256 needed)
TokiInsufficientPoolLiquidity
error TokiInsufficientPoolLiquidity(uint256 value, uint256 needed)
TokiInvalidAppVersion
error TokiInvalidAppVersion(uint256 expected, uint256 actual)
TokiInvalidBalanceDeficitFeeZone
error TokiInvalidBalanceDeficitFeeZone()
TokiInvalidPacketType
error TokiInvalidPacketType(uint8)
TokiInvalidProposedVersion
error TokiInvalidProposedVersion(string version)
TokiInvalidRecipientBytes
error TokiInvalidRecipientBytes()
TokiInvalidRetryType
error TokiInvalidRetryType(uint8)
TokiInvalidSafeZoneRange
error TokiInvalidSafeZoneRange(uint256 min, uint256 max)
TokiMock
error TokiMock(string message)
TokiNativeTransferIsFailed
error TokiNativeTransferIsFailed(address to, uint256 value)
TokiNoFee
error TokiNoFee()
TokiNoPeerPoolInfo
error TokiNoPeerPoolInfo()
TokiNoPool
error TokiNoPool(uint256 poolId)
TokiNoRevertReceive
error TokiNoRevertReceive()
TokiNotEnoughNativeFee
error TokiNotEnoughNativeFee(uint256 value, uint256 limit)
TokiPeerPoolInfoNotFound
error TokiPeerPoolInfoNotFound(uint256 chainId, uint256 poolId)
TokiPeerPoolIsAlreadyActive
error TokiPeerPoolIsAlreadyActive(uint256 chainId, uint256 poolId)
TokiPeerPoolIsNotReady
error TokiPeerPoolIsNotReady(uint256 peerChainId, uint256 peerPoolId)
TokiPeerPoolIsRegistered
error TokiPeerPoolIsRegistered(uint256 chainId, uint256 poolId)
TokiPoolRecvIsFailed
error TokiPoolRecvIsFailed(uint256 poolId)
TokiPoolWithdrawConfirmIsFailed
error TokiPoolWithdrawConfirmIsFailed(uint256 poolId)
TokiPriceIsExpired
error TokiPriceIsExpired(uint256 updatedAt)
TokiPriceIsNotPositive
error TokiPriceIsNotPositive(int256 value)
TokiRequireOrderedChannel
error TokiRequireOrderedChannel()
TokiRetryExpired
error TokiRetryExpired(uint256 expiryBlock)
TokiSamePool
error TokiSamePool(uint256 poolId, address pool)
TokiSlippageTooHigh
error TokiSlippageTooHigh(uint256 amountGD, uint256 eqReward, uint256 eqFee, uint256 minAmountGD)
TokiTransferIsFailed
error TokiTransferIsFailed(address token, address to, uint256 value)
TokiTransferIsStop
error TokiTransferIsStop()
TokiUnregisteredChainId
error TokiUnregisteredChainId(string channel)
TokiUnregisteredPoolId
error TokiUnregisteredPoolId(uint256 poolId)
TokiZeroAddress
error TokiZeroAddress(string message)
TokiZeroAmount
error TokiZeroAmount(string message)
TokiZeroValue
error TokiZeroValue(string message)
creation bytecode
0x60806040523460355766038d7ea4c6800060045566354a6ba7a180006005556025336039565b506040516113d790816100c28239f35b5f80fd5b6001600160a01b0381165f9081525f5160206114995f395f51905f52602052604090205460ff1660bc576001600160a01b03165f8181525f5160206114995f395f51905f5260205260408120805460ff191660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b505f9056fe6080806040526004361015610012575f80fd5b5f3560e01c90816301ffc9a714610c305750806316ae917b14610bf45780631bd610eb14610b98578063248a9ca314610b485780632a0425e814610ab75780632b3ec8c914610a775780632f2ff15d14610a1c578063343a76fa146109be57806336568abe146109365780633ac6a381146108ec57806346625a2f146108b1578063741a70731461084757806374d839e51461055c57806380651ee21461051d578063918f8674146104dd57806391d14854146104695780639aa2b245146103f0578063a0b50fe314610395578063a217fddf1461035d578063a484b25514610313578063ac82cae1146102d5578063b4daa0751461026b578063bd32f96514610230578063c55d0f56146101e8578063cb36e89a146101a05763d547741f1461013a575f80fd5b3461019c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c5761019a600435610177610cec565b90610195610190825f525f602052600160405f20015490565b611067565b611199565b005b5f80fd5b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57602060406101de600435611261565b0151604051908152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576004355f526001602052602060405f2054604051908152f35b3461019c575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576020600554604051908152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c577fe69219372a813611f7afa23d1382980eb8be1d16f2eda1350621bf7e2fef8be860206004356102c8610fff565b80600455604051908152a1005b3461019c575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576020604051655af3107a40008152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57604061034f600435610dae565b825191151582526020820152f35b3461019c575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c5760206040515f8152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57602073ffffffffffffffffffffffffffffffffffffffff6103e6600435611261565b5116604051908152f35b3461019c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576004357ffb645c6072fb9449c25b08a7a70f4f468051bc0dc34e5347f514a7fb41ad7f376020602435610450610fff565b835f526003825280600160405f200155604051908152a2005b3461019c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576104a0610cec565b6004355f525f60205273ffffffffffffffffffffffffffffffffffffffff60405f2091165f52602052602060ff60405f2054166040519015158152f35b3461019c575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576020604051670de0b6b3a76400008152f35b3461019c575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576020655af3107a4000604051908152f35b3461019c5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c5760043560243560443573ffffffffffffffffffffffffffffffffffffffff811680910361019c57606435916105be610fff565b80156107e857811561078957604051917f313ce567000000000000000000000000000000000000000000000000000000008352602083600481845afa801561077e5785935f9161073a575b50936060929184957fa2b2f4a861fceba2018edb5ecdd26fcf386e726f60a71e80618caed3ac99c009955f5260026020528360405f205560016040519161064f83610d24565b83835260ff60208401911681526040830190858252895f52600360205273ffffffffffffffffffffffffffffffffffffffff60405f209451167fffffffffffffffffffffff00000000000000000000000000000000000000000074ff00000000000000000000000000000000000000008654935160a01b169216171783555191015560405192835260208301526040820152a26106eb81610dae565b908015610733575b6106f957005b60207f945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd69683891835f52600182528060405f2055604051908152a2005b505f6106f3565b919350506020813d602011610776575b8161075760209383610d6d565b8101031261019c57519060ff8216820361019c57849290916060610609565b3d915061074a565b6040513d5f823e3d90fd5b6040517fd786f8be00000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f70726963654665656441646472657373000000000000000000000000000000006044820152606490fd5b6040517f4612b38f00000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f62617365207072696365000000000000000000000000000000000000000000006044820152606490fd5b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c577f1507bf6854ffd313b6a5296ce4a7f0cee301b1d0e0230fdbaad8989864bef3e660206004356108a4610fff565b80600555604051908152a1005b3461019c575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576020600454604051908152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57602060ff8161092b600435611261565b015116604051908152f35b3461019c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c5761096d610cec565b3373ffffffffffffffffffffffffffffffffffffffff8216036109965761019a90600435611199565b7f6697b232000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461019c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57600435602435801515810361019c57610a0582610dae565b918115610a14575b506106f957005b905083610a0d565b3461019c5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c5761019a600435610a59610cec565b90610a72610190825f525f602052600160405f20015490565b6110cd565b3461019c575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57602066038d7ea4c68000604051908152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57610b08600435805f526001602052610b0260405f205491610d0f565b90610f9c565b6040516003821015610b1b576020918152f35b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576020610b906004355f525f602052600160405f20015490565b604051908152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576040600435805f52600160205260ff6020610be5845f205493611261565b01511682519182526020820152f35b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c576020610b90600435610d0f565b3461019c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019c57600435907fffffffff00000000000000000000000000000000000000000000000000000000821680920361019c57817f7965db0b0000000000000000000000000000000000000000000000000000000060209314908115610cc2575b5015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483610cbb565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361019c57565b5f52600260205260405f205480156107e85790565b6060810190811067ffffffffffffffff821117610d4057604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610d4057604052565b90815f52600160205260405f205490825f52600260205260405f2054610ddc610dd685611261565b94610d0f565b600460a073ffffffffffffffffffffffffffffffffffffffff875116604051928380927ffeaf968c0000000000000000000000000000000000000000000000000000000082525afa95861561077e575f915f97610ed5575b505f821315610ea95742871015610ea0576040610e518842610f2b565b915b015110610e7457610e7093949550818082109118021893846112e3565b9190565b857fc8341324000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b60405f91610e53565b507f68158112000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b9150955060a0813d60a011610f23575b81610ef260a09383610d6d565b8101031261019c57610f03816112cc565b506020810151610f1a6080606084015193016112cc565b5090955f610e34565b3d9150610ee5565b91908203918211610f3857565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8115610f6f570490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b81811015610ff957610fae9082610f2b565b90670de0b6b3a7640000820291808304670de0b6b3a76400001490151715610f3857610fd991610f65565b6004548111610fe757505f90565b60055410610ff457600190565b600290565b50505f90565b335f9081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff161561103757565b7fe2517d3f000000000000000000000000000000000000000000000000000000005f52336004525f60245260445ffd5b805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff33165f5260205260ff60405f2054161561109e5750565b7fe2517d3f000000000000000000000000000000000000000000000000000000005f523360045260245260445ffd5b805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260ff60405f205416155f14610ff957805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260405f2060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905573ffffffffffffffffffffffffffffffffffffffff339216907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d5f80a4600190565b805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260ff60405f2054165f14610ff957805f525f60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260405f207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905573ffffffffffffffffffffffffffffffffffffffff339216907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b5f80a4600190565b5f6040805161126f81610d24565b82815282602082015201525f52600360205260405f206040519061129282610d24565b600181549160ff73ffffffffffffffffffffffffffffffffffffffff84169384865260a01c16602085015201546040830152156107895790565b519069ffffffffffffffffffff8216820361019c57565b6112f76112f08484610f9c565b9382610f9c565b926003841015610b1b576003811015610b1b5783036113725781158061137a575b611372578161132691611383565b670de0b6b3a7640000810290808204670de0b6b3a76400001490151715610f385760019161135391610f65565b910361136557655af3107a4000111590565b66038d7ea4c68000111590565b505050600190565b50801515611318565b81811115611398579061139591610f2b565b90565b61139591610f2b56fea264697066735822122032a8025af1d010425438337a2e7af3ef815cac53f7435ee68edeb245a90e769d64736f6c634300081c0033ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5