-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore: move all contract related logic to contracts folder #355
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b405b6b
feat: XMTP messages contracts are upgradeable and pausable
fbac d2a93dd
feat: add tests and scripts
fbac 3fc2edb
add finished scripts
fbac ce42140
include finished contracts, ci and readme
fbac bc37841
make CI happy
fbac e07716d
move contract dev scripts to dev/contracts
fbac cc661e2
generate config in human readable names
fbac 0f862bf
chore: move contract logic to contracts folder
fbac 6797e30
rebase
fbac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,10 +1,10 @@ | ||
{ | ||
"addresses": { | ||
"groupMessagesDeployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"groupMessagesImpl": "0x0a17FabeA4633ce714F1Fa4a2dcA62C3bAc4758d", | ||
"groupMessagesProxy": "0x3C1Cb427D20F15563aDa8C249E71db76d7183B6c", | ||
"groupMessagesImpl": "0xc5a5C42992dECbae36851359345FE25997F5C42d", | ||
"groupMessagesProxy": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933", | ||
"groupMessagesProxyAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" | ||
}, | ||
"deploymentBlock": 65, | ||
"latestUpgradeBlock": 71 | ||
"deploymentBlock": 28, | ||
"latestUpgradeBlock": 28 | ||
} |
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,10 +1,10 @@ | ||
{ | ||
"addresses": { | ||
"identityUpdatesDeployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"identityUpdatesImpl": "0x1343248Cbd4e291C6979e70a138f4c774e902561", | ||
"identityUpdatesProxy": "0x22a9B82A6c3D2BFB68F324B2e8367f346Dd6f32a", | ||
"identityUpdatesImpl": "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E", | ||
"identityUpdatesProxy": "0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690", | ||
"identityUpdatesProxyAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" | ||
}, | ||
"deploymentBlock": 67, | ||
"latestUpgradeBlock": 67 | ||
"deploymentBlock": 30, | ||
"latestUpgradeBlock": 30 | ||
} |
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
File renamed without changes.
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,70 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# Default directories (can be overridden with environment variables) | ||
source_dir="${SOURCE_DIR:-src}" | ||
build_dir="${BUILD_DIR:-build}" | ||
output_dir="${OUTPUT_DIR:-pkg}" | ||
|
||
# Ensure required directories exist and clean up old artifacts | ||
function setup_directories() { | ||
mkdir -p "${build_dir}" "${output_dir}" | ||
} | ||
|
||
# Generate bindings for a given contract | ||
function generate_bindings() { | ||
local filename="$1" | ||
local package="$(echo "${filename}" | tr '[:upper:]' '[:lower:]')" | ||
local source_artifact="${source_dir}/${filename}.sol" | ||
local build_artifact="${build_dir}/${filename}" | ||
local output_artifact="${output_dir}/${package}/${filename}.go" | ||
|
||
rm -f "${build_artifact}".*.json | ||
mkdir -p "${output_dir}/${package}" | ||
rm -f "${output_dir}/${package}"/*.go | ||
|
||
# Generate ABI and bytecode | ||
if ! forge inspect "${source_artifact}:${filename}" abi > "${build_artifact}.abi.json"; then | ||
echo "ERROR: Failed to generate ABI for ${filename}" >&2 | ||
exit 1 | ||
fi | ||
|
||
if ! forge inspect "${source_artifact}:${filename}" bytecode > "${build_artifact}.bin.json"; then | ||
echo "ERROR: Failed to generate bytecode for ${filename}" >&2 | ||
exit 1 | ||
fi | ||
|
||
# Generate Go bindings | ||
if ! abigen --abi "${build_artifact}.abi.json" \ | ||
--bin "${build_artifact}.bin.json" \ | ||
--pkg "${package}" \ | ||
--type "${filename}" \ | ||
--out "${output_artifact}" > /dev/null 2>&1; then | ||
echo "ERROR: Failed to generate bindings for ${filename}" >&2 | ||
exit 1 | ||
fi | ||
} | ||
|
||
function main() { | ||
# Always work from the contracts directory | ||
script_dir=$(dirname "$(realpath "$0")") | ||
repo_root=$(realpath "${script_dir}/../") | ||
cd "${repo_root}" | ||
|
||
setup_directories | ||
|
||
# Define contracts (pass as arguments or use a default list) | ||
local contracts=("$@") | ||
if [ "${#contracts[@]}" -eq 0 ]; then | ||
contracts=("Nodes" "GroupMessages" "IdentityUpdates") | ||
fi | ||
|
||
# Generate bindings for each contract | ||
for contract in "${contracts[@]}"; do | ||
echo "Processing contract: ${contract}" | ||
generate_bindings "${contract}" | ||
done | ||
} | ||
|
||
main "$@" |
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
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
pkg/abis/groupMessages.go → contracts/pkg/groupmessages/GroupMessages.go
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
pkg/abis/identityUpdates.go → ...ts/pkg/identityupdates/IdentityUpdates.go
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Standardize the deployment approach for nodes contract
The deployment approach for the nodes contract differs from other cases in several ways:
forge create
instead offorge script
like other cases../build/
instead ofconfig/anvil_localnet/
Consider standardizing this by:
forge script