编译器
0.8.19+commit.7dd6d404
文件 1 的 7:Commission.sol
pragma solidity 0.8.19;
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
error CommissionTransferFailed();
error NativeClaimFailed();
error NotEnoughBalance();
error ZeroAddress();
error ViolationOfFixedNativeTokensLimit();
error UnauthorizedCommissionReceiver(address caller);
error PercentageLimitExceeded();
error InvalidProportionSum(uint8 proportion1, uint8 proportion2);
error TakeFixedNativeTokensCommissionFailed(uint256 sent, uint256 required);
error ZeroFixedNativeTokensCommissionLimit();
error EnablingZeroFixedNativeTokenCommission();
error EnablingZeroFixedTokenCommission();
error EnablingZeroTokenPercentageCommission();
abstract contract Commission is Ownable2Step, ReentrancyGuard {
address internal immutable TOKEN;
uint256 private constant ONE_HUNDRED = 100;
uint256 private immutable FIXED_NATIVE_TOKEN_COMMISSION_LIMIT;
enum CommissionType {
PercentageTokens,
FixedTokens,
FixedNativeTokens
}
CommissionSettings public commissionSettings;
struct CommissionSettings {
uint8 convertTokenPercentage;
uint8 receiverCommissionProportion;
uint8 bridgeOwnerCommissionProportion;
uint16 pointOffsetShifter;
bool commissionIsEnabled;
uint256 fixedNativeTokensCommission;
uint256 fixedTokenCommission;
CommissionType commissionType;
address payable receiverCommission;
address payable bridgeOwner;
}
bytes4 private constant TRANSFERFROM_SELECTOR = 0x23b872dd;
bytes4 internal constant TRANSFER_SELECTOR = 0xa9059cbb;
event UpdateReceiver(address indexed previousReceiver, address indexed newReceiver);
event UpdateCommissionType(
bool indexed commissionIsEnabled,
uint256 indexed commissionType,
uint256 indexed timestamp
);
event UpdateFixedNativeTokensCommission(
uint256 indexed timestamp,
uint256 fixedNativeTokensCommission
);
event UpdateFixedTokensCommission(
uint256 indexed timestamp,
uint256 fixedTokenCommission
);
event UpdatePercentageTokensCommission(
uint256 indexed timestamp,
uint256 convertTokenPercentage,
uint256 pointOffsetShifter
);
event UpdateCommissionProportions(
uint8 receiverCommissionProportion,
uint8 bridgeOwnerCommissionProportion,
uint256 updateTimestamp
);
event FixedNativeTokensCommissionClaim(uint256 indexed time);
modifier isCommissionReceiver(address caller) {
if (
_msgSender() != commissionSettings.receiverCommission &&
_msgSender() != commissionSettings.bridgeOwner
)
revert UnauthorizedCommissionReceiver(_msgSender());
_;
}
modifier checkProportion(uint8 proportionOne, uint8 proportionTwo) {
if (proportionOne + proportionTwo != uint8(100))
revert InvalidProportionSum(proportionOne, proportionTwo);
_;
}
modifier notZeroAddress(address account) {
if (account == address(0))
revert ZeroAddress();
_;
}
constructor(
address token,
bool commissionIsEnabled,
uint8 receiverCommissionProportion,
uint8 bridgeOwnerCommissionProportion,
uint256 fixedNativeTokensCommissionLimit,
address payable receiverCommission,
address payable bridgeOwner
)
Ownable()
notZeroAddress(token)
notZeroAddress(bridgeOwner)
{
TOKEN = token;
if (fixedNativeTokensCommissionLimit == 0)
revert ZeroFixedNativeTokensCommissionLimit();
FIXED_NATIVE_TOKEN_COMMISSION_LIMIT = fixedNativeTokensCommissionLimit;
uint256 timestamp = block.timestamp;
if (commissionIsEnabled) {
commissionSettings.commissionIsEnabled = true;
emit UpdateCommissionType(true, 0, timestamp);
}
if (receiverCommission != address(0)) {
commissionSettings.receiverCommission = payable(receiverCommission);
emit UpdateReceiver(address(0), receiverCommission);
updateCommissionProportions(receiverCommissionProportion, bridgeOwnerCommissionProportion);
} else {
updateCommissionProportions(0, 100);
}
commissionSettings.bridgeOwner = payable(bridgeOwner);
emit UpdateReceiver(address(0), bridgeOwner);
emit UpdateCommissionProportions(
receiverCommissionProportion,
bridgeOwnerCommissionProportion,
timestamp
);
}
function disableCommission() external onlyOwner {
commissionSettings.commissionIsEnabled = false;
emit UpdateCommissionType(false, uint256(commissionSettings.commissionType), block.timestamp);
}
function enableAndUpdateFixedNativeTokensCommission(
uint256 newFixedNativeTokensCommission
)
external
onlyOwner
{
uint256 timestamp = block.timestamp;
if (!commissionSettings.commissionIsEnabled) {
commissionSettings.commissionIsEnabled = true;
}
if ( commissionSettings.commissionType != CommissionType.FixedNativeTokens) {
if (newFixedNativeTokensCommission == 0)
revert EnablingZeroFixedNativeTokenCommission();
commissionSettings.commissionType = CommissionType.FixedNativeTokens;
emit UpdateCommissionType(true, 2, timestamp);
}
_checkFixedFixedNativeTokensLimit(newFixedNativeTokensCommission);
commissionSettings.fixedNativeTokensCommission = newFixedNativeTokensCommission;
emit UpdateFixedNativeTokensCommission(timestamp, newFixedNativeTokensCommission);
}
function enableAndUpdateFixedTokensCommission(uint256 newFixedTokenCommission) external onlyOwner {
uint256 timestamp = block.timestamp;
if (!commissionSettings.commissionIsEnabled)
commissionSettings.commissionIsEnabled = true;
if (commissionSettings.commissionType != CommissionType.FixedTokens) {
if (newFixedTokenCommission == 0)
revert EnablingZeroFixedTokenCommission();
commissionSettings.commissionType = CommissionType.FixedTokens;
emit UpdateCommissionType(true, 1, timestamp);
}
commissionSettings.fixedTokenCommission = newFixedTokenCommission;
emit UpdateFixedTokensCommission(timestamp, newFixedTokenCommission);
}
function enableAndUpdatePercentageTokensCommission(
uint8 newConvertTokenPercentage,
uint16 newPointOffsetShifter
)
external
onlyOwner
{
uint256 timestamp = block.timestamp;
if (!commissionSettings.commissionIsEnabled)
commissionSettings.commissionIsEnabled = true;
if (commissionSettings.commissionType != CommissionType.PercentageTokens) {
if (newConvertTokenPercentage == 0 || newPointOffsetShifter == 0)
revert EnablingZeroTokenPercentageCommission();
commissionSettings.commissionType = CommissionType.PercentageTokens;
emit UpdateCommissionType(true, 0, timestamp);
}
_checkPercentageLimit(newConvertTokenPercentage, newPointOffsetShifter);
commissionSettings.pointOffsetShifter = newPointOffsetShifter;
commissionSettings.convertTokenPercentage = newConvertTokenPercentage;
emit UpdatePercentageTokensCommission(
timestamp,
newConvertTokenPercentage,
newPointOffsetShifter
);
}
function updateReceiverCommission(address newReceiverCommission) external onlyOwner {
if(newReceiverCommission == address(0))
updateCommissionProportions(0, 100);
emit UpdateReceiver(commissionSettings.receiverCommission, newReceiverCommission);
commissionSettings.receiverCommission = payable(newReceiverCommission);
}
function updateBridgeOwner(address newBridgeOwner)
external
onlyOwner
notZeroAddress(newBridgeOwner)
{
emit UpdateReceiver(commissionSettings.bridgeOwner, newBridgeOwner);
commissionSettings.bridgeOwner = payable(newBridgeOwner);
}
function claimFixedNativeTokensCommission()
external
nonReentrant
isCommissionReceiver(_msgSender())
{
CommissionSettings memory cachedCommissionSettings = commissionSettings;
uint256 contractBalance = address(this).balance;
if (contractBalance == 0 )
revert NotEnoughBalance();
if (
cachedCommissionSettings.receiverCommissionProportion != 0
) {
(bool sendToReceiver, ) =
cachedCommissionSettings.receiverCommission
.call{
value:
contractBalance * cachedCommissionSettings.receiverCommissionProportion
/ ONE_HUNDRED
}("");
if (!sendToReceiver) {
revert NativeClaimFailed();
}
}
(bool sendToOwner,) =
commissionSettings.bridgeOwner
.call{
value:
contractBalance * cachedCommissionSettings.bridgeOwnerCommissionProportion
/ ONE_HUNDRED
}("");
if (!sendToOwner)
revert NativeClaimFailed();
emit FixedNativeTokensCommissionClaim(block.timestamp);
}
function getCommissionReceiverAddresses() external view returns(address, address) {
return (commissionSettings.receiverCommission, commissionSettings.bridgeOwner);
}
function getCommissionSettings() external view returns (
bool commissionIsEnabled,
uint8 receiverCommissionProportion,
uint8 bridgeOwnerCommissionProportion,
uint8 convertTokenPercentage,
uint16 offsetShifter,
uint256 tokenTypeCommission,
uint256 fixedTokenCommission,
uint256 fixedNativeTokensCommission,
address payable receiverCommission,
address payable bridgeOwner,
address token
) {
return (
commissionSettings.commissionIsEnabled,
commissionSettings.receiverCommissionProportion,
commissionSettings.bridgeOwnerCommissionProportion,
commissionSettings.convertTokenPercentage,
commissionSettings.pointOffsetShifter,
uint256(commissionSettings.commissionType),
commissionSettings.fixedTokenCommission,
commissionSettings.fixedNativeTokensCommission,
commissionSettings.receiverCommission,
commissionSettings.bridgeOwner,
TOKEN
);
}
function updateCommissionProportions(
uint8 newReceiverCommissionProportion,
uint8 newBridgeOwnerCommissionProportion
)
public
onlyOwner
checkProportion(
newReceiverCommissionProportion,
newBridgeOwnerCommissionProportion
)
{
CommissionSettings memory cachedCommissionSettings = commissionSettings;
if (cachedCommissionSettings.receiverCommissionProportion != newReceiverCommissionProportion)
commissionSettings.receiverCommissionProportion = newReceiverCommissionProportion;
if (
newBridgeOwnerCommissionProportion != 0 &&
cachedCommissionSettings.bridgeOwnerCommissionProportion != newBridgeOwnerCommissionProportion
)
commissionSettings.bridgeOwnerCommissionProportion = newBridgeOwnerCommissionProportion;
emit UpdateCommissionProportions(
cachedCommissionSettings.receiverCommissionProportion,
cachedCommissionSettings.bridgeOwnerCommissionProportion,
block.timestamp
);
}
function _checkPayedCommissionInNative() internal {
CommissionSettings memory cachedCommissionSettings = commissionSettings;
if (msg.value != cachedCommissionSettings.fixedNativeTokensCommission) {
revert TakeFixedNativeTokensCommissionFailed(
msg.value,
cachedCommissionSettings.fixedNativeTokensCommission
);
}
}
function _takeCommissionInTokenOutput(uint256 amount) internal returns (uint256) {
CommissionSettings memory cachedCommissionSettings = commissionSettings;
(uint256 commissionAmountBridgeOwner, uint256 commissionSum) =
_calculateCommissionInToken(amount);
if (cachedCommissionSettings.receiverCommissionProportion != 0 && commissionSum != commissionAmountBridgeOwner) {
(bool transferToReceiver, ) = TOKEN.call(
abi.encodeWithSelector(
TRANSFERFROM_SELECTOR,
_msgSender(),
cachedCommissionSettings.receiverCommission,
commissionSum - commissionAmountBridgeOwner
)
);
if (!transferToReceiver)
revert CommissionTransferFailed();
}
(bool transferToBridgeOwner, ) = TOKEN.call(
abi.encodeWithSelector(
TRANSFERFROM_SELECTOR,
_msgSender(),
cachedCommissionSettings.bridgeOwner,
commissionAmountBridgeOwner
)
);
if(!transferToBridgeOwner)
revert CommissionTransferFailed();
return commissionSum;
}
function _takeCommissionInTokenInput(uint256 amount) internal returns (uint256) {
CommissionSettings memory cachedCommissionSettings = commissionSettings;
(uint256 commissionAmountBridgeOwner, uint256 commissionSum) =
_calculateCommissionInToken(amount);
if (cachedCommissionSettings.receiverCommissionProportion != 0 && commissionSum != commissionAmountBridgeOwner) {
(bool transferToReceiver, ) = TOKEN.call(
abi.encodeWithSelector(
TRANSFER_SELECTOR,
cachedCommissionSettings.receiverCommission,
commissionSum - commissionAmountBridgeOwner
)
);
if (!transferToReceiver)
revert CommissionTransferFailed();
}
(bool transferToBridgeOwner, ) = TOKEN.call(
abi.encodeWithSelector(
TRANSFER_SELECTOR,
cachedCommissionSettings.bridgeOwner,
commissionAmountBridgeOwner
)
);
if (!transferToBridgeOwner)
revert CommissionTransferFailed();
return commissionSum;
}
function _calculateCommissionInToken(uint256 amount) internal view returns (uint256, uint256) {
CommissionSettings memory cachedCommissionSettings = commissionSettings;
if (cachedCommissionSettings.commissionType == CommissionType.PercentageTokens) {
uint256 commissionSum = amount* uint256(cachedCommissionSettings.convertTokenPercentage) / cachedCommissionSettings.pointOffsetShifter;
return (
_calculateCommissionBridgeOwnerProportion(commissionSum),
commissionSum
);
}
return (
_calculateCommissionBridgeOwnerProportion(
cachedCommissionSettings.fixedTokenCommission
),
cachedCommissionSettings.fixedTokenCommission
);
}
function _calculateCommissionBridgeOwnerProportion(uint256 amount) private view returns(uint256) {
return (amount * uint256(commissionSettings.bridgeOwnerCommissionProportion) / ONE_HUNDRED);
}
function _checkFixedFixedNativeTokensLimit(uint256 fixedNativeTokensCommission) private view {
if (fixedNativeTokensCommission > FIXED_NATIVE_TOKEN_COMMISSION_LIMIT)
revert ViolationOfFixedNativeTokensLimit();
}
function _checkPercentageLimit(uint8 convertTokenPercentage, uint16 pointOffsetShifter) private pure {
if (convertTokenPercentage > pointOffsetShifter)
revert PercentageLimitExceeded();
}
}
文件 2 的 7:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
文件 3 的 7:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 4 的 7:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 5 的 7:Ownable2Step.sol
pragma solidity ^0.8.0;
import "./Ownable.sol";
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
function acceptOwnership() public virtual {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
}
文件 6 的 7:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
文件 7 的 7:TokenConversionManagerV2.sol
pragma solidity 0.8.19;
import "./Commission.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
error ViolationOfTxAmountLimits();
error InvalidRequestOrSignature();
error UsedSignature();
error ConversionFailed();
error ConversionMintFailed();
error InvalidUpdateConfigurations();
error MintingMoreThanMaxSupply();
contract TokenConversionManagerV2 is Commission {
address private _conversionAuthorizer;
bytes4 private constant MINT_SELECTOR = 0x40c10f19;
bytes4 private constant BURN_SELECTOR = 0x79cc6790;
mapping (bytes32 => bool) private _usedSignatures;
uint256 private _perTxnMinAmount;
uint256 private _perTxnMaxAmount;
uint256 private _maxSupply;
event NewAuthorizer(address conversionAuthorizer);
event UpdateConfiguration(uint256 perTxnMinAmount, uint256 perTxnMaxAmount, uint256 maxSupply);
event ConversionOut(address indexed tokenHolder, bytes32 conversionId, uint256 amount);
event ConversionIn(address indexed tokenHolder, bytes32 conversionId, uint256 amount);
modifier checkLimits(uint256 amount) {
if (amount < _perTxnMinAmount || amount > _perTxnMaxAmount)
revert ViolationOfTxAmountLimits();
_;
}
constructor(
address token,
bool commissionIsEnabled,
uint8 receiverCommissionProportion,
uint8 bridgeOwnerCommissionProportion,
uint256 fixedNativeTokenCommissionLimit,
address payable commissionReceiver,
address payable bridgeOwner
)
Commission(
token,
commissionIsEnabled,
receiverCommissionProportion,
bridgeOwnerCommissionProportion,
fixedNativeTokenCommissionLimit,
commissionReceiver,
bridgeOwner
)
{
_conversionAuthorizer = _msgSender();
}
function updateAuthorizer(address newAuthorizer) external notZeroAddress(newAuthorizer) onlyOwner {
_conversionAuthorizer = newAuthorizer;
emit NewAuthorizer(newAuthorizer);
}
function updateConfigurations(
uint256 perTxnMinAmount,
uint256 perTxnMaxAmount,
uint256 maxSupply
)
external
onlyOwner
{
if (perTxnMinAmount == 0 || perTxnMaxAmount <= perTxnMinAmount || maxSupply == 0)
revert InvalidUpdateConfigurations();
_perTxnMinAmount = perTxnMinAmount;
_perTxnMaxAmount = perTxnMaxAmount;
_maxSupply = maxSupply;
emit UpdateConfiguration(perTxnMinAmount, perTxnMaxAmount, maxSupply);
}
function conversionOut(
uint256 amount,
bytes32 conversionId,
uint8 v,
bytes32 r,
bytes32 s
)
external
payable
checkLimits(amount)
nonReentrant
{
bool success;
bytes32 message = prefixed(
keccak256(
abi.encodePacked(
"__conversionOut",
amount,
_msgSender(),
conversionId,
this
)
)
);
if (ecrecover(message, v, r, s) != _conversionAuthorizer)
revert InvalidRequestOrSignature();
if (_usedSignatures[message])
revert UsedSignature();
_usedSignatures[message] = true;
if (commissionSettings.commissionIsEnabled) {
if (commissionSettings.commissionType == CommissionType.FixedNativeTokens) {
_checkPayedCommissionInNative();
(success, ) = TOKEN.call(abi.encodeWithSelector(BURN_SELECTOR, _msgSender(), amount));
} else {
(success, ) = TOKEN.call(abi.encodeWithSelector(BURN_SELECTOR, _msgSender(), amount - _takeCommissionInTokenOutput(amount)));
}
} else {
(success, ) = TOKEN.call(abi.encodeWithSelector(BURN_SELECTOR, _msgSender(), amount));
}
if (!success)
revert ConversionFailed();
emit ConversionOut(_msgSender(), conversionId, amount);
}
function conversionIn(
address to,
uint256 amount,
bytes32 conversionId,
uint8 v,
bytes32 r,
bytes32 s
)
external
payable
checkLimits(amount)
nonReentrant
notZeroAddress(to)
{
bool success;
bytes32 message = prefixed(
keccak256(
abi.encodePacked(
"__conversionIn",
amount,
_msgSender(),
conversionId,
this
)
)
);
if (ecrecover(message, v, r, s) != _conversionAuthorizer)
revert InvalidRequestOrSignature();
if (_usedSignatures[message])
revert UsedSignature();
_usedSignatures[message] = true;
if (IERC20(TOKEN).totalSupply() + amount > _maxSupply)
revert MintingMoreThanMaxSupply();
if (commissionSettings.commissionIsEnabled) {
if (commissionSettings.commissionType == CommissionType.FixedNativeTokens) {
_checkPayedCommissionInNative();
(success, ) = TOKEN.call(abi.encodeWithSelector(MINT_SELECTOR, to, amount));
} else {
(success, ) = TOKEN.call(abi.encodeWithSelector(MINT_SELECTOR, address(this), amount));
if (!success)
revert ConversionMintFailed();
(success, ) = TOKEN.call(abi.encodeWithSelector(TRANSFER_SELECTOR, to, amount - _takeCommissionInTokenInput(amount)));
}
} else {
(success, ) = TOKEN.call(abi.encodeWithSelector(MINT_SELECTOR, to, amount));
}
if (!success)
revert ConversionFailed();
emit ConversionIn(to, conversionId, amount);
}
function prefixed(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function getConversionAuthorizer() external view returns(address) {
return _conversionAuthorizer;
}
function getConversionConfigurations() external view returns(uint256,uint256,uint256) {
return(_perTxnMinAmount, _perTxnMaxAmount, _maxSupply);
}
}
{
"compilationTarget": {
"contracts/TokenConversionManagerV2.sol": "TokenConversionManagerV2"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"commissionIsEnabled","type":"bool"},{"internalType":"uint8","name":"receiverCommissionProportion","type":"uint8"},{"internalType":"uint8","name":"bridgeOwnerCommissionProportion","type":"uint8"},{"internalType":"uint256","name":"fixedNativeTokenCommissionLimit","type":"uint256"},{"internalType":"address payable","name":"commissionReceiver","type":"address"},{"internalType":"address payable","name":"bridgeOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CommissionTransferFailed","type":"error"},{"inputs":[],"name":"ConversionFailed","type":"error"},{"inputs":[],"name":"ConversionMintFailed","type":"error"},{"inputs":[],"name":"EnablingZeroFixedNativeTokenCommission","type":"error"},{"inputs":[],"name":"EnablingZeroFixedTokenCommission","type":"error"},{"inputs":[],"name":"EnablingZeroTokenPercentageCommission","type":"error"},{"inputs":[{"internalType":"uint8","name":"proportion1","type":"uint8"},{"internalType":"uint8","name":"proportion2","type":"uint8"}],"name":"InvalidProportionSum","type":"error"},{"inputs":[],"name":"InvalidRequestOrSignature","type":"error"},{"inputs":[],"name":"InvalidUpdateConfigurations","type":"error"},{"inputs":[],"name":"MintingMoreThanMaxSupply","type":"error"},{"inputs":[],"name":"NativeClaimFailed","type":"error"},{"inputs":[],"name":"NotEnoughBalance","type":"error"},{"inputs":[],"name":"PercentageLimitExceeded","type":"error"},{"inputs":[{"internalType":"uint256","name":"sent","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"TakeFixedNativeTokensCommissionFailed","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"UnauthorizedCommissionReceiver","type":"error"},{"inputs":[],"name":"UsedSignature","type":"error"},{"inputs":[],"name":"ViolationOfFixedNativeTokensLimit","type":"error"},{"inputs":[],"name":"ViolationOfTxAmountLimits","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroFixedNativeTokensCommissionLimit","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenHolder","type":"address"},{"indexed":false,"internalType":"bytes32","name":"conversionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ConversionIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenHolder","type":"address"},{"indexed":false,"internalType":"bytes32","name":"conversionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ConversionOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"time","type":"uint256"}],"name":"FixedNativeTokensCommissionClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"conversionAuthorizer","type":"address"}],"name":"NewAuthorizer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"receiverCommissionProportion","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"bridgeOwnerCommissionProportion","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"updateTimestamp","type":"uint256"}],"name":"UpdateCommissionProportions","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"commissionIsEnabled","type":"bool"},{"indexed":true,"internalType":"uint256","name":"commissionType","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"UpdateCommissionType","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"perTxnMinAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"perTxnMaxAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"UpdateConfiguration","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fixedNativeTokensCommission","type":"uint256"}],"name":"UpdateFixedNativeTokensCommission","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fixedTokenCommission","type":"uint256"}],"name":"UpdateFixedTokensCommission","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"convertTokenPercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pointOffsetShifter","type":"uint256"}],"name":"UpdatePercentageTokensCommission","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousReceiver","type":"address"},{"indexed":true,"internalType":"address","name":"newReceiver","type":"address"}],"name":"UpdateReceiver","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimFixedNativeTokensCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"commissionSettings","outputs":[{"internalType":"uint8","name":"convertTokenPercentage","type":"uint8"},{"internalType":"uint8","name":"receiverCommissionProportion","type":"uint8"},{"internalType":"uint8","name":"bridgeOwnerCommissionProportion","type":"uint8"},{"internalType":"uint16","name":"pointOffsetShifter","type":"uint16"},{"internalType":"bool","name":"commissionIsEnabled","type":"bool"},{"internalType":"uint256","name":"fixedNativeTokensCommission","type":"uint256"},{"internalType":"uint256","name":"fixedTokenCommission","type":"uint256"},{"internalType":"enum Commission.CommissionType","name":"commissionType","type":"uint8"},{"internalType":"address payable","name":"receiverCommission","type":"address"},{"internalType":"address payable","name":"bridgeOwner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"conversionId","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"conversionIn","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"conversionId","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"conversionOut","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"disableCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFixedNativeTokensCommission","type":"uint256"}],"name":"enableAndUpdateFixedNativeTokensCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFixedTokenCommission","type":"uint256"}],"name":"enableAndUpdateFixedTokensCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"newConvertTokenPercentage","type":"uint8"},{"internalType":"uint16","name":"newPointOffsetShifter","type":"uint16"}],"name":"enableAndUpdatePercentageTokensCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCommissionReceiverAddresses","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCommissionSettings","outputs":[{"internalType":"bool","name":"commissionIsEnabled","type":"bool"},{"internalType":"uint8","name":"receiverCommissionProportion","type":"uint8"},{"internalType":"uint8","name":"bridgeOwnerCommissionProportion","type":"uint8"},{"internalType":"uint8","name":"convertTokenPercentage","type":"uint8"},{"internalType":"uint16","name":"offsetShifter","type":"uint16"},{"internalType":"uint256","name":"tokenTypeCommission","type":"uint256"},{"internalType":"uint256","name":"fixedTokenCommission","type":"uint256"},{"internalType":"uint256","name":"fixedNativeTokensCommission","type":"uint256"},{"internalType":"address payable","name":"receiverCommission","type":"address"},{"internalType":"address payable","name":"bridgeOwner","type":"address"},{"internalType":"address","name":"token","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getConversionAuthorizer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getConversionConfigurations","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAuthorizer","type":"address"}],"name":"updateAuthorizer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBridgeOwner","type":"address"}],"name":"updateBridgeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"newReceiverCommissionProportion","type":"uint8"},{"internalType":"uint8","name":"newBridgeOwnerCommissionProportion","type":"uint8"}],"name":"updateCommissionProportions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"perTxnMinAmount","type":"uint256"},{"internalType":"uint256","name":"perTxnMaxAmount","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"updateConfigurations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newReceiverCommission","type":"address"}],"name":"updateReceiverCommission","outputs":[],"stateMutability":"nonpayable","type":"function"}]