Skip to content

cronos-labs/cronos-accelerator-workshop-hardhat

Repository files navigation

Tip Content Creator solidity contract

This repo contains a contract that implements tipping functionality.

Install dependencies with npm install.

Set up by creating a .env file, and filling out these variables:

PRIVATE_KEY="your_private_key"
EXPLORER_MAINNET_API_KEY="your_cronos_explorer_testnet_api_key"
COINMARKETCAP_API="your_cointmarketcap_api_key"

!!! Be very careful with exporting your private key !!!

You can get your Private Key from MetaMask like this. If you have any questions or concerns about this, please find someone you trust to sanity check you!

!!! Be very careful with exporting your private key !!!

Deploy your contract with:

npx hardhat run scripts/deploy.ts --network cronosTestnet

Run a tipping simulation locally with:

npx hardhat run scripts/tipSimulation.ts

Once you have a contract deployed to Cronos testnet, grab the contract address and update the DEPLOYED_CONTRACT_ADDRESS variable in constants.ts, then:

npx hardhat run scripts/withdraw.ts

will allow you to withdraw any tips stored on the contract.

About

Example repository for workshop

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published