-
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.
Merge pull request #124 from CirclesUBI/20240320-merge
20240320 merge
- Loading branch information
Showing
38 changed files
with
494 additions
and
223 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 |
---|---|---|
|
@@ -12,3 +12,6 @@ out/ | |
|
||
# Dotenv file | ||
.env | ||
|
||
# OSX | ||
.DS_Store |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PRIVATE_KEY_CHIADO='YOUR_PRIVATE_KEY' | ||
RPC_URL_CHIADO='https://rpc.chiadochain.net' | ||
BLOCKSCOUT_API_KEY='YOUR_API_KEY' | ||
BLOCKSCOUT_URL_CHIADO='https://gnosis-chiado.blockscout.com/api?' | ||
BLOCKSCOUT_VERIFIER='blockscout' | ||
GNOSISSCAN_API_KEY='YOUR_API_KEY' | ||
GNOSISSCAN_URL='https://api.gnosisscan.io/api?' | ||
GNOSISSCAN_VERIFIER='etherscan' |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
# Node | ||
node_modules | ||
npm-debug.log | ||
package-lock.json |
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 @@ | ||
# Deploying Circles contracts |
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,104 @@ | ||
#!/bin/bash | ||
|
||
# note 26 march 2024: this does not work yet, the compiler version gets rejected | ||
|
||
# Script to verify deployed contracts on a block explorer | ||
|
||
# Function to verify contract on Block Explorer | ||
verify_contract() { | ||
local contractName=$1 | ||
local deployedAddress=$2 | ||
local sourcePath=$3 | ||
local constructorArgsFile=$4 | ||
local compilerVersion=$5 | ||
|
||
echo "Verifying ${contractName} at ${deployedAddress} with source ${sourcePath}" | ||
|
||
# Perform verification using forge with constructor args from file | ||
forge verify-contract --flatten --watch --compiler-version "${compilerVersion}" \ | ||
--constructor-args-path "${constructorArgsFile}" \ | ||
--chain-id 10200 \ | ||
--verifier-url $VERIFIER_URL \ | ||
--verifier $VERIFIER \ | ||
--etherscan-api-key ${VERIFIER_API_KEY} \ | ||
--delay 10 \ | ||
"${deployedAddress}" "${sourcePath}" | ||
|
||
echo "Verification command for ${contractName} executed." | ||
} | ||
|
||
# Set the environment variables, also for use in node script | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
source "$DIR/../../.env" | ||
|
||
# The identifier containing deployment details | ||
DEPLOYMENT_IDENTIFIER=$1 | ||
# The file containing deployment details | ||
ARTEFACTS_FILE="${DEPLOYMENT_IDENTIFIER}/${DEPLOYMENT_IDENTIFIER}.txt" | ||
PATH_CONSTRUCTOR_ARGS="${DEPLOYMENT_IDENTIFIER}" | ||
|
||
echo "Using artefacts file: ${ARTEFACTS_FILE}" | ||
|
||
# taking parameters from .env file for Chiado | ||
VERIFIER_URL=$BLOCKSCOUT_URL_CHIADO | ||
VERIFIER_API_KEY=$BLOCKSCOUT_API_KEY | ||
VERIFIER=$BLOCKSCOUT_VERIFIER | ||
COMPILER_VERSION="v0.8.23+commit.f704f362" | ||
|
||
# Assuming jq is installed for JSON parsing | ||
# Reading the JSON file and extracting required information | ||
while IFS= read -r line; do | ||
contractName=$(echo "$line" | jq -r '.contractName') | ||
deployedAddress=$(echo "$line" | jq -r '.deployedAddress') | ||
sourcePath=$(echo "$line" | jq -r '.sourcePath') | ||
argumentsFile="${PATH_CONSTRUCTOR_ARGS}/$(echo "$line" | jq -r '.argumentsFile')" | ||
compilerVersion=${COMPILER_VERSION} | ||
|
||
# Construct the full path to the constructor args file | ||
constructorArgsFile="${DIR}/${argumentsFile}" | ||
|
||
verify_contract "$contractName" "$deployedAddress" "$sourcePath" "$constructorArgsFile" "$compilerVersion" | ||
done < "${ARTEFACTS_FILE}" | ||
|
||
echo "All contracts submitted for verification." | ||
|
||
|
||
# deploy_and_verify() { | ||
# local contract_name=$1 | ||
# local precalculated_address=$2 | ||
# local deployment_output | ||
# local deployed_address | ||
|
||
# echo "" >&2 | ||
# echo "Deploying ${contract_name}..." >&2 | ||
# deployment_output=$(forge create \ | ||
# --rpc-url ${RPC_URL} \ | ||
# --private-key ${PRIVATE_KEY} \ | ||
# --optimizer-runs 200 \ | ||
# --chain-id 10200 \ | ||
# --verify \ | ||
# --verifier-url $VERIFIER_URL \ | ||
# --verifier $VERIFIER \ | ||
# --etherscan-api-key ${VERIFIER_API_KEY} \ | ||
# --delay 20 \ | ||
# "${@:3}") # Passes all arguments beyond the second to forge create | ||
|
||
# deployed_address=$(echo "$deployment_output" | grep "Deployed to:" | awk '{print $3}') | ||
# echo "${contract_name} deployed at ${deployed_address}" >&2 | ||
|
||
# # Verify that the deployed address matches the precalculated address | ||
# if [ "$deployed_address" = "$precalculated_address" ]; then | ||
# echo "Verification Successful: Deployed address matches the precalculated address for ${contract_name}." >&2 | ||
# else | ||
# echo "Verification Failed: Deployed address does not match the precalculated address for ${contract_name}." >&2 | ||
# echo "Precalculated Address: $precalculated_address" >&2 | ||
# echo "Deployed Address: $deployed_address" >&2 | ||
# # exit the script if the addresses don't match | ||
# exit 1 | ||
# fi | ||
|
||
# echo "sleeping for 10 seconds to allow verifier to verify" >&2 | ||
# sleep 10 | ||
|
||
# echo "$deployed_address" | ||
# } |
18 changes: 18 additions & 0 deletions
18
script/deployments/chiado-0.3.0-63cc025-240325-195322/chiado-0.3.0-63cc025-240325-195322.log
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,18 @@ | ||
Chiado deployment | ||
================= | ||
Deployment Date: 2024-03-25 19:53:22 | ||
Version: 0.3.0 | ||
Git Commit: 63cc025a80350a453f7fefc3eedbd39e43d52075 | ||
Deployer Address: 0x7619F26728Ced663E50E578EB6ff42430931564c | ||
Deployer Nonce: 63 | ||
|
||
Deployed Contracts: | ||
Hub: 0xda2776764BF01DC7f77f5b58df62221c89958A89 | ||
Migration: 0xad0aeD7d4fdB82f6Ed3ddd851A7a3456c979dF7C | ||
NameRegistry: 0x088D6f062fF77653D86BCcd6027CEa4CB09d9ACD | ||
ERC20Lift: 0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da | ||
StandardTreasury: 0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201 | ||
BaseGroupMintPolicy: 0x738fFee24770d0DE1f912adf2B48b0194780E9AD | ||
MastercopyDemurrageERC20: 0xB6B79BeEfd58cf33b298A456934554cf440354aD | ||
MastercopyInflationaryERC20: 0xbb76CF35ec106c5c7a447246257dcfCB7244cA04 | ||
MastercopyStandardVault: 0x5Ea08c967C69255d82a4d26e36823a720E7D0317 |
9 changes: 9 additions & 0 deletions
9
script/deployments/chiado-0.3.0-63cc025-240325-195322/chiado-0.3.0-63cc025-240325-195322.txt
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,9 @@ | ||
{"contractName":"Hub","deployedAddress":"0xda2776764BF01DC7f77f5b58df62221c89958A89","sourcePath":"src/hub/Hub.sol:Hub","constructor-args":"--constructor-args 0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0x088D6f062fF77653D86BCcd6027CEa4CB09d9ACD 0xad0aeD7d4fdB82f6Ed3ddd851A7a3456c979dF7C 0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201 1675209600 31540000 https://fallback.aboutcircles.com/v1/circles/{id}.json","argumentsFile":"constructorArgs_Hub.txt"} | ||
{"contractName":"Migration","deployedAddress":"0xad0aeD7d4fdB82f6Ed3ddd851A7a3456c979dF7C","sourcePath":"src/migration/Migration.sol:Migration","constructor-args":"--constructor-args 0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0xda2776764BF01DC7f77f5b58df62221c89958A89","argumentsFile":"constructorArgs_Migration.txt"} | ||
{"contractName":"NameRegistry","deployedAddress":"0x088D6f062fF77653D86BCcd6027CEa4CB09d9ACD","sourcePath":"src/names/NameRegistry.sol:NameRegistry","constructor-args":"--constructor-args 0xda2776764BF01DC7f77f5b58df62221c89958A89","argumentsFile":"constructorArgs_NameRegistry.txt"} | ||
{"contractName":"ERC20Lift","deployedAddress":"0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da","sourcePath":"src/lift/ERC20Lift.sol:ERC20Lift","constructor-args":"--constructor-args 0xda2776764BF01DC7f77f5b58df62221c89958A89 0x088D6f062fF77653D86BCcd6027CEa4CB09d9ACD 0xB6B79BeEfd58cf33b298A456934554cf440354aD 0xbb76CF35ec106c5c7a447246257dcfCB7244cA04","argumentsFile":"constructorArgs_ERC20Lift.txt"} | ||
{"contractName":"StandardTreasury","deployedAddress":"0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201","sourcePath":"src/treasury/StandardTreasury.sol:StandardTreasury","constructor-args":"--constructor-args 0xda2776764BF01DC7f77f5b58df62221c89958A89 0x5Ea08c967C69255d82a4d26e36823a720E7D0317","argumentsFile":"constructorArgs_StandardTreasury.txt"} | ||
{"contractName":"BaseGroupMintPolicy","deployedAddress":"0x738fFee24770d0DE1f912adf2B48b0194780E9AD","sourcePath":"src/groups/BaseMintPolicy.sol:MintPolicy","constructor-args":"","argumentsFile":"constructorArgs_BaseGroupMintPolicy.txt"} | ||
{"contractName":"MastercopyDemurrageERC20","deployedAddress":"0xB6B79BeEfd58cf33b298A456934554cf440354aD","sourcePath":"src/lift/DemurrageCircles.sol:DemurrageCircles","constructor-args":"","argumentsFile":"constructorArgs_MastercopyDemurrageERC20.txt"} | ||
{"contractName":"MastercopyInflationaryERC20","deployedAddress":"0xbb76CF35ec106c5c7a447246257dcfCB7244cA04","sourcePath":"src/lift/InflationaryCircles.sol:InflationaryCircles","constructor-args":"","argumentsFile":"constructorArgs_MastercopyInflationaryERC20.txt"} | ||
{"contractName":"MastercopyStandardVault","deployedAddress":"0x5Ea08c967C69255d82a4d26e36823a720E7D0317","sourcePath":"src/treasury/StandardVault.sol:StandardVault","constructor-args":"","argumentsFile":"constructorArgs_MastercopyStandardVault.txt"} |
1 change: 1 addition & 0 deletions
1
...pt/deployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_BaseGroupMintPolicy.txt
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 @@ | ||
|
1 change: 1 addition & 0 deletions
1
script/deployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_ERC20Lift.txt
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 @@ | ||
0xda2776764BF01DC7f77f5b58df62221c89958A89 0x088D6f062fF77653D86BCcd6027CEa4CB09d9ACD 0xB6B79BeEfd58cf33b298A456934554cf440354aD 0xbb76CF35ec106c5c7a447246257dcfCB7244cA04 |
1 change: 1 addition & 0 deletions
1
script/deployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_Hub.txt
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 @@ | ||
0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0x088D6f062fF77653D86BCcd6027CEa4CB09d9ACD 0xad0aeD7d4fdB82f6Ed3ddd851A7a3456c979dF7C 0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201 1675209600 31540000 https://fallback.aboutcircles.com/v1/circles/{id}.json |
1 change: 1 addition & 0 deletions
1
...ployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_MastercopyDemurrageERC20.txt
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 @@ | ||
|
1 change: 1 addition & 0 deletions
1
...yments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_MastercopyInflationaryERC20.txt
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 @@ | ||
|
1 change: 1 addition & 0 deletions
1
...eployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_MastercopyStandardVault.txt
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 @@ | ||
|
1 change: 1 addition & 0 deletions
1
script/deployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_Migration.txt
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 @@ | ||
0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0xda2776764BF01DC7f77f5b58df62221c89958A89 |
1 change: 1 addition & 0 deletions
1
script/deployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_NameRegistry.txt
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 @@ | ||
0xda2776764BF01DC7f77f5b58df62221c89958A89 |
1 change: 1 addition & 0 deletions
1
script/deployments/chiado-0.3.0-63cc025-240325-195322/constructorArgs_StandardTreasury.txt
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 @@ | ||
0xda2776764BF01DC7f77f5b58df62221c89958A89 0x5Ea08c967C69255d82a4d26e36823a720E7D0317 |
Oops, something went wrong.