Purr Stream codecov

Purr.Stream is a donation webapp where donated ETH is given to animal shelters around the world with a leaderboard system. The administrator of the contract takes the amounts that were donated for regular donation.

Deployment details

Superposition mainnet

Deployment nameDeployment address
Donation impl0x59E42D2f43D8684690257c6413947034A90ccAF9
Proxy admin owner0x9ef9F76e5CC9Ce656f03c69B56fb6bdA1875f652
Operator0x9ef9F76e5CC9Ce656f03c69B56fb6bdA1875f652
Proxy admin0x2dfc133656cf80487672b518f8a4ae146f548b6c
Transparent proxy0x856257AdAA752CF59594551791bEfB3697f2ED39

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.

IDonationView

Git Source

Functions

get

get the amount of spn donated to a specific cat.

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

Parameters

NameTypeDescription
catbytes8to show.

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
walletaddressto get the amount donated for.

Returns

NameTypeDescription
<none>uint256the amount

walletCount

walletCount that interacted with this cat.

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

Parameters

NameTypeDescription
catbytes8to use.

Returns

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

IDonationMaker

Git Source

Functions

makeDonation

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

function makeDonation(bytes8 cat) external payable;

Parameters

NameTypeDescription
catbytes8to donate to, keccak hashed. Trimmed.

IDonationAdmin

Git Source

Functions

reset

reset the state internally.

Operator only.

function reset() external;

IDonation

Git Source

Inherits: IDonationView, IDonationMaker, IDonationAdmin

Events

Donated

event Donated(bytes8 indexed cat, address indexed donater, uint256 indexed amount);

DonationsDrained

event DonationsDrained(uint256 amount);