Skip to main content

Module FeeModel

Module FeeModel 

Source
Expand description

Generated by the following Solidity interface…

interface FeeModel {
    error AccessControlBadConfirmation();
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    event FeeBpsUpdated(uint256 feeBps);
    event ProtocolFeeCollectorUpdated(address indexed collector);
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    constructor(address admin, uint256 _feeBps, address _protocolFeeCollector);

    function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
    function MAX_BPS() external view returns (uint256);
    function calculateFee(uint256 amount) external view returns (uint256 fee);
    function feeBps() external view returns (uint256);
    function getRoleAdmin(bytes32 role) external view returns (bytes32);
    function grantRole(bytes32 role, address account) external;
    function hasRole(bytes32 role, address account) external view returns (bool);
    function protocolFeeCollector() external view returns (address);
    function renounceRole(bytes32 role, address callerConfirmation) external;
    function revokeRole(bytes32 role, address account) external;
    function setFeeBps(uint256 _feeBps) external;
    function setProtocolFeeCollector(address _collector) external;
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

…which was generated by the following JSON ABI:

[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "admin",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_feeBps",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_protocolFeeCollector",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "DEFAULT_ADMIN_ROLE",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MAX_BPS",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "calculateFee",
    "inputs": [
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "fee",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "feeBps",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getRoleAdmin",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "grantRole",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "hasRole",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "protocolFeeCollector",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "renounceRole",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "callerConfirmation",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "revokeRole",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setFeeBps",
    "inputs": [
      {
        "name": "_feeBps",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setProtocolFeeCollector",
    "inputs": [
      {
        "name": "_collector",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "supportsInterface",
    "inputs": [
      {
        "name": "interfaceId",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "event",
    "name": "FeeBpsUpdated",
    "inputs": [
      {
        "name": "feeBps",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ProtocolFeeCollectorUpdated",
    "inputs": [
      {
        "name": "collector",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "RoleAdminChanged",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "previousAdminRole",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "newAdminRole",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "RoleGranted",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "sender",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "RoleRevoked",
    "inputs": [
      {
        "name": "role",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "sender",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "AccessControlBadConfirmation",
    "inputs": []
  },
  {
    "type": "error",
    "name": "AccessControlUnauthorizedAccount",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "neededRole",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  }
]

Structs§

AccessControlBadConfirmation
Custom error with signature AccessControlBadConfirmation() and selector 0x6697b232.
AccessControlUnauthorizedAccount
Custom error with signature AccessControlUnauthorizedAccount(address,bytes32) and selector 0xe2517d3f.
DEFAULT_ADMIN_ROLECall
Function with signature DEFAULT_ADMIN_ROLE() and selector 0xa217fddf.
DEFAULT_ADMIN_ROLEReturn
Container type for the return parameters of the DEFAULT_ADMIN_ROLE() function.
FeeBpsUpdated
Event with signature FeeBpsUpdated(uint256) and selector 0x0399aa81c69e33acc2ff42d0f7a0809e6bf4c10ff3c3a7e040b12fedc14602f2.
FeeModelInstance
A FeeModel instance.
MAX_BPSCall
Function with signature MAX_BPS() and selector 0xfd967f47.
MAX_BPSReturn
Container type for the return parameters of the MAX_BPS() function.
ProtocolFeeCollectorUpdated
Event with signature ProtocolFeeCollectorUpdated(address) and selector 0x33837f672315b6cffcf11894714abfdec631a913c18d7738fcaf40c444376fb6.
RoleAdminChanged
Event with signature RoleAdminChanged(bytes32,bytes32,bytes32) and selector 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff.
RoleGranted
Event with signature RoleGranted(bytes32,address,address) and selector 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d.
RoleRevoked
Event with signature RoleRevoked(bytes32,address,address) and selector 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b.
calculateFeeCall
Function with signature calculateFee(uint256) and selector 0x99a5d747.
calculateFeeReturn
Container type for the return parameters of the calculateFee(uint256) function.
constructorCall
Constructor`.
feeBpsCall
Function with signature feeBps() and selector 0x24a9d853.
feeBpsReturn
Container type for the return parameters of the feeBps() function.
getRoleAdminCall
Function with signature getRoleAdmin(bytes32) and selector 0x248a9ca3.
getRoleAdminReturn
Container type for the return parameters of the getRoleAdmin(bytes32) function.
grantRoleCall
Function with signature grantRole(bytes32,address) and selector 0x2f2ff15d.
grantRoleReturn
Container type for the return parameters of the grantRole(bytes32,address) function.
hasRoleCall
Function with signature hasRole(bytes32,address) and selector 0x91d14854.
hasRoleReturn
Container type for the return parameters of the hasRole(bytes32,address) function.
protocolFeeCollectorCall
Function with signature protocolFeeCollector() and selector 0x850a1501.
protocolFeeCollectorReturn
Container type for the return parameters of the protocolFeeCollector() function.
renounceRoleCall
Function with signature renounceRole(bytes32,address) and selector 0x36568abe.
renounceRoleReturn
Container type for the return parameters of the renounceRole(bytes32,address) function.
revokeRoleCall
Function with signature revokeRole(bytes32,address) and selector 0xd547741f.
revokeRoleReturn
Container type for the return parameters of the revokeRole(bytes32,address) function.
setFeeBpsCall
Function with signature setFeeBps(uint256) and selector 0x72c27b62.
setFeeBpsReturn
Container type for the return parameters of the setFeeBps(uint256) function.
setProtocolFeeCollectorCall
Function with signature setProtocolFeeCollector(address) and selector 0xcfca3147.
setProtocolFeeCollectorReturn
Container type for the return parameters of the setProtocolFeeCollector(address) function.
supportsInterfaceCall
Function with signature supportsInterface(bytes4) and selector 0x01ffc9a7.
supportsInterfaceReturn
Container type for the return parameters of the supportsInterface(bytes4) function.

Enums§

FeeModelCalls
Container for all the FeeModel function calls.
FeeModelErrors
Container for all the FeeModel custom errors.
FeeModelEvents
Container for all the FeeModel events.

Functions§

new
Creates a new wrapper around an on-chain FeeModel contract instance.