{"id":19303801,"url":"https://github.com/web3w/mint-contracts","last_synced_at":"2025-06-10T22:04:25.965Z","repository":{"id":111890341,"uuid":"309669250","full_name":"web3w/mint-contracts","owner":"web3w","description":"mint contracts","archived":false,"fork":false,"pushed_at":"2021-01-14T03:19:54.000Z","size":388,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T03:50:08.863Z","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/web3w.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}},"created_at":"2020-11-03T11:46:57.000Z","updated_at":"2021-01-14T03:19:57.000Z","dependencies_parsed_at":"2023-03-30T04:02:17.152Z","dependency_job_id":null,"html_url":"https://github.com/web3w/mint-contracts","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fmint-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fmint-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fmint-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fmint-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3w","download_url":"https://codeload.github.com/web3w/mint-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fmint-contracts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259159655,"owners_count":22814492,"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":"2024-11-09T23:27:36.643Z","updated_at":"2025-06-10T22:04:25.943Z","avatar_url":"https://github.com/web3w.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mint \n\nmint token\n\n```js\noz init\n```\n\nnetworks.js\nhttps://docs.openzeppelin.com/cli/2.8/truffle\n\ncreate2\nhttps://ethfans.org/posts/getting-the-most-out-of-create2\n## Run\n\n### node run\n支持 console.log 的节点节点环境 `npx buidler node`\n```js \n  npx buidler help\n  node scripts/sample-script.js //未通过\n```\n\n### compile\n根据 solidity 版本编译代码\n\u003e 注意 Mint Token 中的 get chainid的操作码无法通过编译需要修改一下。\n\n### test\n```js\n let rolsSha3 = web3.utils.soliditySha3(\"MINTER_ROLE\")\n // 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6\n```\n\n\n### deploy\nropsten网络\n### 合约地址\n\u003emintToken 0x8936E7208F94b7a8F77fa2dA139513d02c3B7431\nhttps://ropsten.etherscan.io/address/0x8936E7208F94b7a8F77fa2dA139513d02c3B7431#contracts\n \n\u003emintBreeder 0xD99501cEC2D253B918a6af1928Fa1272a9f231fE\n https://ropsten.etherscan.io/address/0xD99501cEC2D253B918a6af1928Fa1272a9f231fE#contracts\n \n### 矿池\n* aDaiToken: \"0xF8dAcF50a51722C7b37F600D924B14Af9382EFC1\"\n* aUSDTToken: \"0x5e5Fbc55b93e77a60BfFA9c50A6524ACDe1496a8\"\n \n### 起始挖矿块高：9052810\n\n### 解锁收益块高: 9052910\n\n\n\n### verfiy code \n必须使用 Truffle 进行发布后才能进行验证。 注需要翻墙使用\n```\ntruffle run verify MintToken --network ropsten\ntruffle run verify MintBreeder --network ropsten\n```\n\n### Remix\n```js\ntruffle-flattener contracts/token/MintToken.sol \u003e flattener/MintToken.sol\ntruffle-flattener contracts/farm/MintBreeder.sol \u003e flattener/MintBreeder.sol\n```\n\n### Mintbreeder  挖矿合约步骤解析\n\n一、存入: stake,\n``` js\nawait aToken.allowance(alice, mintBreeder.address);\nawait aToken.approve( mintBreeder.address, '1000', {from: alice});\nawait mintBreeder.stake(0, '100', {from: alice});\n```\n\n二、收回 unStake\n``` js\nLet userInfo = await mintBreeder.userInfo(0,alice)\nuserInfo.amount // 用户抵押数量\nawait  mintBreeder.unstake(0, \"2000\", {from: alice})\n```\n \n三、收获Claim\n``` js\n// 1   需要块高大于 enableClaimBlock\nLet enableClaimBlock = await  mintBreeder.enableClaimBlock()\nenableClaimBlock \u003c= blockNumber\n\n \n// 2   查询当前用户挖矿数量计算 \nlet user = await  mintBreeder.userInfo(0,alice)\nLet pool = await  mintBreeder.poolInfo(0)\nlet reward = user.amount.mul(pool.accMintPerShare).div(1e12).sub(user.rewardDebt);\nLet  claimAmount =   reward + user. pendingReward\n\nawait  mintBreeder.claim(0, {from: alice}) \n\n//3.  查看收获的MC代币\nconst aliceBal = await mintToken.balanceOf(alice);\n```\n \n \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fmint-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3w%2Fmint-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fmint-contracts/lists"}