relevant tag icon
HSKO - Husko Money
copy icon
Husko-Money-$HSKO
• version 1.0.0
meme
charity
polygon
token

HSKO - Husko Money

HSKO donates 0.5% of every transaction to charity.

*Visit desktop site to download or deploy

Version

1.0.0

Last Publish

12/5/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
initialize(uint256) :
This function is used to initialize the HuskoToken contract. It sets the initial supply of tokens, the protocol fee, the address of the protocol fee receiver, and the cap. It also calls the __Ownable_init() and __ERC20_init() functions to set the token name and symbol. Finally, it calls the _mint() function to mint the initial supply of tokens to the message sender. (autogenerated documentation)
receiveDonation(address) :
This function receives a donation from a donor and distributes it to the recipient, the protocol fee receiver, and a randomly selected charity. The protocol fee is calculated as a percentage of the donation amount and is split between the protocol fee receiver and the randomly selected charity. The remaining amount is sent to the recipient. (autogenerated documentation)
mint(uint256) :
This function allows the owner of the contract to mint a specified amount of tokens. It first checks to make sure that the total supply of tokens plus the amount to be minted does not exceed the maximum supply (cap_). If the check passes, it calls the _mint() function to mint the specified amount of tokens to the sender of the transaction. (autogenerated documentation)
random() :
This function generates a random number between 0 and charityIndex (the number of charities stored in the contract). It does this by taking the keccak256 hash of the current block timestamp and converting it to an unsigned integer. This number is then modulo'd by charityIndex + 1 to ensure it is within the range of 0 and charityIndex. (autogenerated documentation)
setProtocolFee(uint256) :
This function allows the owner of the contract to set the protocol fee, which is a fee charged to users for using the protocol. The function takes in a uint256 parameter, which is the new protocol fee, and sets the protocolFee_ variable to this new value. (autogenerated documentation)
setProtocolFeeReciever(address) :
This function allows the owner of the contract to set the address of the protocol fee receiver. The function takes an address as an argument and sets the protocolFeeReciever_ variable to the address provided. This allows the owner to specify which address will receive the protocol fees. (autogenerated documentation)
setCharityAddresses() :
This function sets the charity address list of the contract. It takes an array of addresses as an argument and stores each address in the charityAddressList array. The charityIndex is then set to the length of the array minus one. This function allows the contract to keep track of the different charity addresses that it can send funds to. (autogenerated documentation)
getCharityAddress(uint256) :
This function retrieves the address of a charity from the charityAddressList array. It takes an index as an argument and returns the address of the charity at that index. (autogenerated documentation)
getRandomCharityAddress() :
This function generates a random address from a list of charity addresses stored in a smart contract. It works by generating a random number between 0 and the total number of charity addresses stored in the contract, and then using that number to retrieve the corresponding address from the list. (autogenerated documentation)
setNewVar(string) :
This function sets a new variable called "newVar" in the smart contract. It takes a string as an argument and stores it in the "newVar_" variable. This variable can then be accessed and used by other functions in the smart contract. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i HSKO---Husko-Money
copy icon

Last Publish

12/5/2022

Version

1.0.0

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.