Donation

Git Source

Inherits: IDonation

State Variables

MIN_DONATION

uint256 private constant MIN_DONATION = 0;

version_

uint8 private version_;

operator_

operator_ is able to call the leaderboard crank.

address private operator_;

__unused

__unused

address private __unused;

donationEpoch_

donationEpoch_ that we're currently up to. Used to know whether the latest item in the positions arrays is current.

uint128 donationEpoch_;

positions_

positions_ donated to a cat by each user.

mapping(address => uint256) private positions_;

cats_

cats_ invested in by users. Epoch => cat => amount.

mapping(uint256 => mapping(bytes8 => uint256)) private cats_;

catWallets_

catWallets_ count of the number that donated to the cat.

mapping(uint256 => mapping(bytes8 => uint256)) private catWallets_;

Functions

init

function init(address _operator) external;

get

get the amount of spn donated to a specific cat.

function get(bytes8 _cat) external view returns (uint256);

Parameters

NameTypeDescription
_catbytes8

Returns

NameTypeDescription
<none>uint256the current donation amount for the cat given.

wallet

wallet amount donated

function wallet(address _wallet) external view returns (uint256);

Parameters

NameTypeDescription
_walletaddress

Returns

NameTypeDescription
<none>uint256the amount

walletCount

walletCount that interacted with this cat.

function walletCount(bytes8 _cat) external view returns (uint256);

Parameters

NameTypeDescription
_catbytes8

Returns

NameTypeDescription
<none>uint256amount of wallets that interacted with this cat during the leaderboard window.

makeDonation

makeDonation to the cat given from the amount the user has.

function makeDonation(bytes8 _cat) external payable;

Parameters

NameTypeDescription
_catbytes8

reset

reset the state internally.

Operator only.

function reset() external;

take

function take() external;

updateOperator

updateOperator, with some controls for consistency with forking.

function updateOperator(address _old, address _new) external;

Parameters

NameTypeDescription
_oldaddressoperator to use.
_newaddressoperator to replace it with.