// SPDX-License-Identifier: CC0-1.0 pragma solidity 0.8.17; interface ICompliance { /// events /** * this event is emitted when a token has been bound to the compliance contract * the event is emitted by the bindToken function * `_token` is the address of the token to bind */ event TokenBound(address _token); /** * this event is emitted when a token has been unbound from the compliance contract * the event is emitted by the unbindToken function * `_token` is the address of the token to unbind */ event TokenUnbound(address _token); /// functions /** * @dev binds a token to the compliance contract * @param _token address of the token to bind * This function can be called ONLY by the owner of the compliance contract * Emits a TokenBound event */ function bindToken(address _token) external; /** * @dev unbinds a token from the compliance contract * @param _token address of the token to unbind * This function can be called ONLY by the owner of the compliance contract * Emits a TokenUnbound event */ function unbindToken(address _token) external; /** * @dev function called whenever tokens are transferred * from one wallet to another * this function can be used to update state variables of the compliance contract * This function can be called ONLY by the token contract bound to the compliance * @param _from The address of the sender * @param _to The address of the receiver * @param _amount The amount of tokens involved in the transfer */ function transferred( address _from, address _to, uint256 _amount ) external; /** * @dev function called whenever tokens are created on a wallet * this function can be used to update state variables of the compliance contract * This function can be called ONLY by the token contract bound to the compliance * @param _to The address of the receiver * @param _amount The amount of tokens involved in the minting */ function created(address _to, uint256 _amount) external; /** * @dev function called whenever tokens are destroyed from a wallet * this function can be used to update state variables of the compliance contract * This function can be called ONLY by the token contract bound to the compliance * @param _from The address on which tokens are burnt * @param _amount The amount of tokens involved in the burn */ function destroyed(address _from, uint256 _amount) external; /** * @dev checks that the transfer is compliant. * default compliance always returns true * READ ONLY FUNCTION, this function cannot be used to increment * counters, emit events, ... * @param _from The address of the sender * @param _to The address of the receiver * @param _amount The amount of tokens involved in the transfer * This function will call all checks implemented on compliance * If all checks return TRUE, the function returns TRUE * returns FALSE otherwise */ function canTransfer( address _from, address _to, uint256 _amount ) external view returns (bool); /** * @dev getter for the address of the token bound * returns the address of the token */ function getTokenBound() external view returns (address); }