forked from greenpill-dev-guild/camp-green
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed garden contracts * added action registry * Started to modify contracts for work attestations Added deploy script for Action Registry * added eas schema deployer * added schemas file with attestations needed for MVP. * Action registry completed with comments and optimizations * cleared constant not yet set with 0x0 address or bytes added common error messages added enum for capitals * created schemas struct for resolver to reference attestation onAttest * renamed deploy attestations to resolvers * updated resolvers adding needed imports * removed garden from name so attestations can scale past garden work * created lib for returing community token address * added constatnts for community token and garden * address lint warning with more declartive mapping names * added conditionals for enabling attestations be approved * prettified solidity code * added back tab width 4 and added solhint ignore * fixed eas import mappings * added requires for resolvers made garden mapping public for resolvers to access changed calldata for media update to memory to avoid compiler errpr created get action view function * reverted tab width to 2 for non solidity files * updated deploy scripts * added new constants such as safe and token * updated msg.sender to _msgSender() * added lib to get eas address * made token upgradeable * added overrides just for sol files * created delpoy script action registry, garden token and resolvers * added test for garden token/acount and resolvers * updated mapping using tokenbound forge-std and ds-test * polished libs with documentation and optimizations * polished contracts adding comments for clear documentation * created mock eas for testing * updated lock * added prod env var to set ethers deployment chain * added resolver as option for schema deployment * polished test and commented out test not ready * removed disabling initalizers * added Schema registry addresses moved salt and factory to constants file * added emot for garden name * polished deploy scripts * added title to action created modifier for not action owner * updated sepolia rpc to proper one * fixed solhint config issue * updated commands for deploying splitting into different scripts * updated name for etherscan api key * updated tokenbounsd constants and interface * disabled transfer ownership causing issues * modify intializer test now that owner stays same removed prank multisig with owner now address(this)
- Loading branch information
Showing
40 changed files
with
2,389 additions
and
312 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
{ | ||
"plugins": ["prettier-plugin-solidity"], | ||
"bracketSpacing": true, | ||
"printWidth": 120, | ||
"proseWrap": "always", | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"useTabs": false | ||
"useTabs": false, | ||
"overrides": [ | ||
{ | ||
"files": "*.sol", | ||
"options": { | ||
"parser": "solidity-parse", | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"singleQuote": false | ||
} | ||
} | ||
] | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# directories | ||
broadcast | ||
cache | ||
coverage | ||
node_modules | ||
out |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
ds-test=./node_modules/ds-test/src/ | ||
forge-std=./node_modules/forge-std/src/ | ||
@openzeppelin/contracts=lib/tokenbound/lib/openzeppelin-contracts/contracts/ | ||
@openzeppelin/contracts-upgradeable=./node_modules/@openzeppelin/contracts-upgradeable/ | ||
@eas=./node_modules/@ethereum-attestation-service/eas-contracts/contracts/ | ||
@tokenbound=./lib/tokenbound/src/ | ||
erc6551/=lib/tokenbound/lib/erc6551/src/ | ||
forge-std=./lib/tokenbound/lib/forge-std/src/ | ||
ds-test=./lib/tokenbound/lib/forge-std/lib/ds-test/src/ | ||
@eas=./node_modules/@ethereum-attestation-service/eas-contracts/contracts/ | ||
@openzeppelin/contracts=lib/tokenbound/lib/openzeppelin-contracts/contracts/ | ||
@openzeppelin/contracts-upgradeable=./node_modules/@openzeppelin/contracts-upgradeable/ |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.25; | ||
|
||
import { Script, console } from "forge-std/Script.sol"; | ||
import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol"; | ||
import { FACTORY, SALT } from "../src/Constants.sol"; | ||
import { ActionRegistry, Capital } from "../src/registries/Action.sol"; | ||
|
||
/// @title DeployActionRegistry | ||
/// @notice Script for deploying the ActionRegistry contract using CREATE2. | ||
contract DeployActionRegistry is Script { | ||
function run() public { | ||
// Calculate the CREATE2 address for the ActionRegistry | ||
address predictedRegistryAddress = Create2.computeAddress( | ||
SALT, | ||
keccak256(abi.encodePacked(type(ActionRegistry).creationCode, "")), | ||
FACTORY | ||
); | ||
|
||
// Check if the contract is already deployed | ||
if (predictedRegistryAddress.code.length == 0) { | ||
vm.startBroadcast(); | ||
ActionRegistry newRegistry = new ActionRegistry{ salt: SALT }(); | ||
|
||
Capital[] memory capitals = new Capital[](1); | ||
capitals[0] = Capital.LIVING; | ||
|
||
string[] memory media = new string[](2); | ||
media[0] = "QmWYQY9vnb9ot7u49UMeH41DdjZghrgr2YoaYaNwYSpeAn"; | ||
media[1] = "QmS9K5EdyakRPW7gV86xivaUNx1AuhPUzUSRD53WnjL4Uz"; | ||
|
||
newRegistry.initialize(address(this)); | ||
newRegistry.registerAction( | ||
block.timestamp, | ||
block.timestamp + 30 days, | ||
"Test Action 1", | ||
"QmTmbcRyKtkMpMFWsm6D8YpgwMUuds3jE4sJdjqhqFGvWe", | ||
capitals, | ||
media | ||
); | ||
newRegistry.registerAction( | ||
block.timestamp, | ||
block.timestamp + 30 days, | ||
"Test Action 2", | ||
"QmTmbcRyKtkMpMFWsm6D8YpgwMUuds3jE4sJdjqhqFGvWe", | ||
capitals, | ||
media | ||
); | ||
|
||
vm.stopBroadcast(); | ||
|
||
console.log("ActionRegistry deployed at:", predictedRegistryAddress); | ||
} else { | ||
console.log("ActionRegistry already exists at:", predictedRegistryAddress); | ||
} | ||
|
||
// Print out verification commands | ||
console.log("\nVerification Commands:\n"); | ||
console.log( | ||
"ActionRegistry: forge verify-contract --num-of-optimizations 200 --chain-id", | ||
block.chainid, | ||
predictedRegistryAddress | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.