-
Notifications
You must be signed in to change notification settings - Fork 15
Add contribution token #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Enhancement: Reason String Encoder UtilityPOV:
Proposal: node scripts/encodeReasons.js --input contributions.csv --output contribution-tokens-latest.jsoncan we do this, both were just a suggestion to make it more reliable. The cover is pretty optimal already if I am not wrong though! Thanks |
excellent suggestion! |
|
Understood, LGTM now |
Add Contribution Token (TGC) and Batch Minting Infrastructure
Summary
This PR introduces the TheGuildContributionToken (TGC), an upgradeable ERC20 token for rewarding contributions within The Guild ecosystem. It includes deployment scripts, batch minting capabilities, comprehensive tests, and helper scripts for streamlined operations.
Changes
🆕 New Contracts & Scripts
src/TheGuildContributionToken.sol: Upgradeable ERC20 token (UUPS) with:mint)mintWithReason) that emitsMintedWithReasoneventbatchMint,batchMintWithReason)script/DeployTGC.s.sol: Deterministic deployment script using CREATE2:script/MintTGCFromJson.s.sol: Batch minting script from JSON:vm.parseBytescontribution-tokens-latest.jsonscript/UpgradeTGCImplementation.s.sol: Upgrade script for UUPS proxytest/TheGuildContributionToken.t.sol: Comprehensive test suite:MintedWithReasonevent emission🔧 Improvements to Existing Scripts
run_batch_contribution_tokens.sh:contribution-tokens-latest.jsonPRIVATE_KEY,RPC_URL,TGC_PROXY_ADDRESS)📚 Documentation
README.md:Technical Details
Deterministic Deployment
The
DeployTGCscript uses CREATE2 with salt"theguild_tgc_v_0.1.2"for deterministic addresses across networks. The proxy is deployed without initialization data, theninitialize()is called directly from the deployer EOA to ensure proper ownership setup.JSON Parsing Fix
The batch minting script correctly handles hex string reasons in JSON by:
stdJson.readStringvm.parseBytesThis ensures hex strings like
"0x476974687562..."are properly decoded.Testing
forge test)Deployment
TGC has been deployed to Polygon Amoy:
0x14d403EaE3E0b2E2dc6379C9729Df6906fF38bE7"theguild_tgc_v_0.1.2"Usage Examples
Deploy TGC
Batch Mint from JSON
Breaking Changes
None. This is a new feature addition.
Related Issues