{"id":28515358,"url":"https://github.com/devvspaces/ktty-staking-contract","last_synced_at":"2026-06-25T06:31:48.188Z","repository":{"id":291425158,"uuid":"977518266","full_name":"devvspaces/ktty-staking-contract","owner":"devvspaces","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-27T07:33:03.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T03:05:29.294Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devvspaces.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-04T11:49:23.000Z","updated_at":"2025-05-27T07:33:07.000Z","dependencies_parsed_at":"2025-05-04T15:48:33.805Z","dependency_job_id":null,"html_url":"https://github.com/devvspaces/ktty-staking-contract","commit_stats":null,"previous_names":["devvspaces/ktty-staking-contract"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devvspaces/ktty-staking-contract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvspaces%2Fktty-staking-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvspaces%2Fktty-staking-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvspaces%2Fktty-staking-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvspaces%2Fktty-staking-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devvspaces","download_url":"https://codeload.github.com/devvspaces/ktty-staking-contract/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devvspaces%2Fktty-staking-contract/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265637448,"owners_count":23802714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-09T03:05:29.505Z","updated_at":"2026-06-25T06:31:48.159Z","avatar_url":"https://github.com/devvspaces.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Foundry\n\n**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**\n\nFoundry consists of:\n\n-   **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).\n-   **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.\n-   **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.\n-   **Chisel**: Fast, utilitarian, and verbose solidity REPL.\n\n## Documentation\n\nhttps://book.getfoundry.sh/\n\n## Usage\n\n### Build\n\n```shell\n$ forge build\n```\n\n### Test\n\n```shell\n$ forge test\n```\n\n### Format\n\n```shell\n$ forge fmt\n```\n\n### Gas Snapshots\n\n```shell\n$ forge snapshot\n```\n\n### Anvil\n\n```shell\n$ anvil\n```\n\n### Deploy\n\n```shell\n$ forge script script/Counter.s.sol:CounterScript --rpc-url \u003cyour_rpc_url\u003e --private-key \u003cyour_private_key\u003e\n```\n\n### Cast\n\n```shell\n$ cast \u003csubcommand\u003e\n```\n\n### Help\n\n```shell\n$ forge --help\n$ anvil --help\n$ cast --help\n```\n\n\n```shell\nforge create \\\n  --rpc-url $SEPOLIA_RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  --etherscan-api-key $ETHERSCAN_API_KEY \\\n  --constructor-args \"RoninNFT\" \"RNFT\" \"https://peach-necessary-primate-505.mypinata.cloud/ipfs/bafkreiapgfyjvlyrqy6pnk5k2z63x7v7d7rlh4ju6tiz6iqsntawxm4hwu\" 0x5fbdb2315678afecb367f032d93f642f64180aa3 0xe7f1725e7734ce288f8367e1bb143e90bb3f0512 1744470000 \\\n  --verify \\\n  src/RoninNFT.sol:RoninNFT\n```\n\n## Deployment steps\n\n### Setup the environment variables\n\nCopy the `.env.example` file to `.env` and fill in the required values.\n\n```shell\ncp .env.example .env\n```\n\nSource the `.env` file to load the environment variables.\n\n```shell\nsource .env\n```\n\n### Deploy the contract\n\nMake sure you have the required dependencies installed.\n\n```shell\nforge install\nforge build\n```\n\nRun the deployment script.\n\n```shell\nforge script script/DeployKTTYStakingUpgradeable.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY\n```\n\nRun the upgrade script.\n\n```shell\nforge script script/UpgradeKTTTYStaking.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY\n```\n\nVerify the contract on Roninchain.\n\n```shell\nforge verify-contract --verifier sourcify --verifier-url https://sourcify.roninchain.com/server/ --chain-id 2020 $CONTRACT_ADDRESS src/KTTYStaking.sol:KTTYStaking\n```\n\n### Create tiers\n\nCopy the commands in `init-tiers.sh` to create the tiers in the staking contract.\n\n### Create reward tokens\n\n```shell\ncast send \\\n  --rpc-url \"$RPC_URL\" \\\n  --private-key \"$PRIVATE_KEY\" \\\n  \"$STAKING_CONTRACT_ADDRESS\" \\\n  \"registerRewardToken(address,string,uint256)\" \\\n  \"ADDRESS_HERE\" \\\n  \"SYMBOL_HERE\"  \\\n  1  \\\n  --legacy\n```\n\n```shell\ncast call \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"getAllRewardTokens()(address[],string[])\"\n```\n\n```shell\ncast call $STAKING_CONTRACT_ADDRESS \"removeRewardToken(address,address)\" \"0xd7dABE4D60Ba712F3A582DF3bBda9fD55231CA13\" \"0x981AA7621fB24Ab87c62392cd0f28172F1d375d7\" --rpc-url $RPC_URL --private-key $PRIVATE_KEY\n\n\ncast call $STAKING_CONTRACT_ADDRESS \"removeRewardToken(address,address)\" \"0x06f7481D937Eb637d7d9DEeDf175957d5D881397\" \"0x981AA7621fB24Ab87c62392cd0f28172F1d375d7\" --rpc-url $RPC_URL --private-key $PRIVATE_KEY\n\n\ncast send $STAKING_CONTRACT_ADDRESS \"removeRewardToken(address,address)\" \"0xaF997B85aC9D51969E8eB9FC5B7CDB3Fe188771b\" \"0x981AA7621fB24Ab87c62392cd0f28172F1d375d7\" --rpc-url $RPC_URL --private-key $PRIVATE_KEY\n\n\ncast send $STAKING_CONTRACT_ADDRESS \"removeRewardToken(address,address)\" \"0x2D88f4B225cdf51D1f0582311C16E68a2144421a\" \"0x981AA7621fB24Ab87c62392cd0f28172F1d375d7\" --rpc-url $RPC_URL --private-key $PRIVATE_KEY\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n```shell\nforge script script/MockToken.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY\n\nforge script script/KTTYStaking.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY\n\nforge verify-contract --verifier sourcify --verifier-url https://sourcify.roninchain.com/server/ --chain-id 2020 $CONTRACT_ADDRESS src/KTTYStaking.sol:KTTYStaking\n\nforge script script/Token.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY\n\n# Add a new tier to the staking contract\ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"addTier(string,uint256,uint256,uint256,uint256)\" \\\n  \"Tier 1\" \\\n  $(cast --to-wei \"1\")  \\\n  $(cast --to-wei \"10\")  \\\n  30 \\\n  20000 \\\n  --legacy\n\n# Update a tier on the staking contract\ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"updateTier(uint256,string,uint256,uint256,uint256,uint256,bool)\" \\\n  1 \\\n  \"Entry\" \\\n  $(cast --to-wei \"1000000\")  \\\n  $(cast --to-wei \"2900000\")  \\\n  30 \\\n  20000 \\\n  true \\\n  --legacy\n\n  \ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"updateTier(uint256,string,uint256,uint256,uint256,uint256,bool)\" \\\n  2 \\\n  \"Intermediate\" \\\n  $(cast --to-wei \"3000000\")  \\\n  $(cast --to-wei \"5900000\")  \\\n  60 \\\n  40000 \\\n  true \\\n  --legacy\n\n  \ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"updateTier(uint256,string,uint256,uint256,uint256,uint256,bool)\" \\\n  3 \\\n  \"Advanced\" \\\n  $(cast --to-wei \"6000000\")  \\\n  $(cast --to-wei \"9900000\")  \\\n  90 \\\n  100000 \\\n  true \\\n  --legacy\n\n  \ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"updateTier(uint256,string,uint256,uint256,uint256,uint256,bool)\" \\\n  4 \\\n  \"Diamond\" \\\n  $(cast --to-wei \"10000000\")  \\\n  $(cast --to-wei \"19900000\")  \\\n  120 \\\n  150000 \\\n  true \\\n  --legacy\n\n  \ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"updateTier(uint256,string,uint256,uint256,uint256,uint256,bool)\" \\\n  5 \\\n  \"Platinum\" \\\n  $(cast --to-wei \"20000000\")  \\\n  $(cast --to-wei \"50000000\")  \\\n  180 \\\n  250000 \\\n  true \\\n  --legacy\n  \ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"updateTier(uint256,string,uint256,uint256,uint256,uint256,bool)\" \\\n  1 \\\n  \"Entry\" \\\n  $(cast --to-wei \"1000000\")  \\\n  $(cast --to-wei \"2900000\")  \\\n  180 \\\n  20000 \\\n  true \\\n  --legacy\n\n\n# Mint tokens\n\ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  \"0x4c24d08Cd47894C7Af961325895381CB4216fd4D\" \\\n  \"mint(address,uint256)\" \\\n  \"0xA0Ca70DFB6Fb79fD5EF160D3EAc677868547ffEF\" \\\n  $(cast --to-wei \"2000000000\")  \\\n  --legacy\n\ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  \"0x6F03FC28999a9230A5C8650b8d440098A8B52294\" \\\n  \"allowance(address,address)\" \\\n  \"0xA0Ca70DFB6Fb79fD5EF160D3EAc677868547ffEF\" \\\n  \"0xEdE2bFf384ca4cfdBe4165ED7A02a55D1e10396c\" \\\n  --legacy\n\n\n# Stake\n\ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  \"0xEdE2bFf384ca4cfdBe4165ED7A02a55D1e10396c\" \\\n  \"stake(uint256,uint256)\" \\\n  $(cast --to-wei \"1000000\")  \\\n  1 \\\n  --legacy\n\n\ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"pause()\" \\\n  --legacy\n\ncast send \\\n  --rpc-url $RPC_URL \\\n  --private-key $PRIVATE_KEY \\\n  $STAKING_CONTRACT_ADDRESS \\\n  \"claimRewardsAndWithdraw(uint256)\" \\\n  1 \\\n  --legacy\n  \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevvspaces%2Fktty-staking-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevvspaces%2Fktty-staking-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevvspaces%2Fktty-staking-contract/lists"}