Conversation
Collaborator
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 |
Contributor
Author
excellent suggestion! |
Collaborator
|
Understood, LGTM now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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