-
Notifications
You must be signed in to change notification settings - Fork 21
Contract overview
Smart contract that implements the NEP-141 fungible token standard, as well as NEP-148 metadata and NEP-297 events standard extensions.
Token account - an account with the contract code deployed to it.
Oracle account - an account in an allow-list to provide steps activity data to the token (call the record_batch
contract method).
Oracle - a service that provides verified physical activity data. Has access to Oracle account keys.
Formula - a function that specifies conversion rate of physical activity data to fungible token.
Main purpose of the contract is converting users steps activity data (provided by an Oracle) into fungible tokens:
- Oracle (more specifically, Sweatcoin) periodically records users' verified steps data to the token (via calling the
record_batch
method) - The steps data is converted into fungible tokens via using the formula, and minted to the active user's account, minus 5% commission that is minted to Oracle account for it's verification services.
- The conversion rate (formula) is not static and depends on total steps that have been accumulated in the contract.
Contract implements standard methods of NEP-141 (ft_transfer
, ft_transfer_call
, view methods ft_total_supply
, ft_balance_of
), storage staking methods (storage_deposit
, storage_withdraw
, storage_unregister
, view methods storage_balance_of
and storage_balance_bounds
), and NEP-148 metadata view method ft_metadata
. All of these behave according to the standards.
Adds or removes and account to Oracle allow-list.
Can only be called by the Token Account.
View method that lists current Oracle Accounts
Method that is used at the TGE (token generation event) to mint initial token allocations ("airdrop" as promoted on the Sweatcoin App).
Mints the specified amount of tokens to the provided account.
Emits a NEP-297 ft_mint
event.
Will be removed from the contract after the TGE is conducted.
Same as tge_mint
, but accepts a list of mints. Emits a NEP-297 ft_mint
event per list element.
Used to batch mints together as a performance improvement.
Will be removed from the contract after the TGE is conducted.
Irreversably removes a specified amount of the caller's tokens from circulation.
Emits a NEP-297 ft_burn
event.
View method that returns total amount of steps accumulated in the contract, used by the Formula.
Method that accepts a list of accounts and their steps from the Oracle.
Can only be called by an Oracle.
Mints tokens to the accounts according to Formula, minus 5% commission that is minted to the Oracle account. Adds all the converted steps to the total steps counter.
Emits an NEP-297 ft_mint
event per element in the argument list + a single event for total commission to Oracle.
Batching is a performance optimisation.
Calculates the amount of tokens to be minted into existance with given parameters.