g8keepPenaltyReceiver

g8keepPenaltyReceiver

Inherits: Ownable

Receives tokens from g8keep snipe protection penalties for [redacted].

State Variables

allowedTransferers

Mapping of addresses that are allowed to transfer tokens from the penalty receiver.

mapping(address => uint256) public allowedTransferers;

ALLOWED_TIME_DELAY

Guardrail to prevent a newly added transferer from transfering tokens immediately.

uint256 private constant ALLOWED_TIME_DELAY = 1 days;

Functions

onlyAllowedTransferer

modifier onlyAllowedTransferer();

constructor

Constructs the g8keepPenaltyReceiver contract.

constructor(address _defaultOwner);

Parameters

NameTypeDescription

_defaultOwner

address

The address of the default owner of the contract.

setAllowedTransferer

Admin function to configure a paired token.

function setAllowedTransferer(address transferer, bool allowed) external onlyOwner;

Parameters

NameTypeDescription

transferer

address

Address of the address to set allowed.

allowed

bool

True if the address is allowed to transfer tokens, false if not.

transferToken

Transfers an amount of tokenAddress from the contract to to.

Throws when called by an address that is not an allowed transferer.

function transferToken(address tokenAddress, address to, uint256 amount) external onlyAllowedTransferer;

Parameters

NameTypeDescription

tokenAddress

address

Address of the token to transfer.

to

address

Address to transfer the token to.

amount

uint256

Amount of the token to transfer.

Events

AllowedTransfererUpdated

Emitted when the penalty receiver owner updates an allowed transferer.

event AllowedTransfererUpdated(address indexed transferer, bool allowed, uint256 allowedTime);

Errors

NoUpdate

Thrown when allowing or removing a transferer and no change would be made.

error NoUpdate();

NotAllowed

Thrown when a transfer request is made by an address that is not allowed.

error NotAllowed();

WithdrawalFailed

Thrown when withdrawing a token from the contract and the withdrawal fails.

error WithdrawalFailed();

ZeroAddress

Thrown when attempting to set the zero address as an allowed transferer.

error ZeroAddress();

Last updated