Purr Stream
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 name | Deployment address |
---|---|
Donation impl | 0x59E42D2f43D8684690257c6413947034A90ccAF9 |
Proxy admin owner | 0x9ef9F76e5CC9Ce656f03c69B56fb6bdA1875f652 |
Operator | 0x9ef9F76e5CC9Ce656f03c69B56fb6bdA1875f652 |
Proxy admin | 0x2dfc133656cf80487672b518f8a4ae146f548b6c |
Transparent proxy | 0x856257AdAA752CF59594551791bEfB3697f2ED39 |
Donation
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
Name | Type | Description |
---|---|---|
_cat | bytes8 |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | the current donation amount for the cat given. |
wallet
wallet amount donated
function wallet(address _wallet) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_wallet | address |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | the amount |
walletCount
walletCount that interacted with this cat.
function walletCount(bytes8 _cat) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_cat | bytes8 |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | amount 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
Name | Type | Description |
---|---|---|
_cat | bytes8 |
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
Name | Type | Description |
---|---|---|
_old | address | operator to use. |
_new | address | operator to replace it with. |
IDonationView
Functions
get
get the amount of spn donated to a specific cat.
function get(bytes8 cat) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
cat | bytes8 | to show. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | the current donation amount for the cat given. |
wallet
wallet amount donated
function wallet(address wallet) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
wallet | address | to get the amount donated for. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | the amount |
walletCount
walletCount that interacted with this cat.
function walletCount(bytes8 cat) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
cat | bytes8 | to use. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | amount of wallets that interacted with this cat during the leaderboard window. |
IDonationMaker
Functions
makeDonation
makeDonation to the cat given from the amount the user has.
function makeDonation(bytes8 cat) external payable;
Parameters
Name | Type | Description |
---|---|---|
cat | bytes8 | to donate to, keccak hashed. Trimmed. |
IDonationAdmin
Functions
reset
reset the state internally.
Operator only.
function reset() external;
IDonation
Inherits: IDonationView, IDonationMaker, IDonationAdmin
Events
Donated
event Donated(bytes8 indexed cat, address indexed donater, uint256 indexed amount);
DonationsDrained
event DonationsDrained(uint256 amount);