Skip to content

Feature: oft adapter step3 - deploy script and test#11

Merged
blueogin merged 70 commits into
masterfrom
feat/oft-adatper-step3
Apr 29, 2026
Merged

Feature: oft adapter step3 - deploy script and test#11
blueogin merged 70 commits into
masterfrom
feat/oft-adatper-step3

Conversation

@blueogin

Copy link
Copy Markdown
Collaborator

Description

This PR implements the deployment scripts and testing infrastructure for the GoodDollar OFT (Omnichain Fungible Token) adapter system. The implementation enables cross-chain bridging of GoodDollar tokens between XDC and CELO networks using LayerZero's OFT protocol.

About #7

How Has This Been Tested?

https://layerzeroscan.com/tx/0x3575146c0e395d46b4a3e09ec3ae79e1005ea6d4461765d6dc19d6aebed512bb
https://layerzeroscan.com/tx/0xa267c36a25337ea8d45d83de83a3e83a291ba4d2eaf0fd0393d365faf3c078e8

Checklist:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

…acts, including enabling hardhat-deploy and adding new network configurations for CELO and XDC
… management structures, and add deployment and configuration scripts for cross-chain functionality
…C network, enhance GoodDollarOFTAdapter with upgrade authorization event, and modify deployment scripts for improved functionality

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @blueogin, your pull request is larger than the review limit of 150000 diff characters

@sirpy sirpy changed the base branch from master to feat/oft-adapter-step2 February 2, 2026 07:37
Comment thread packages/bridge-contracts/contracts/oft/GoodDollarOFTAdapter.sol Outdated
Comment thread packages/bridge-contracts/release/deployment.json Outdated
Comment thread packages/bridge-contracts/scripts/oft/configure-oft-xdc-celo.sh Outdated
echo ""

# Step 7: Test bridge (optional, last step)
if [ "$SKIP_BRIDGE_TEST" != "true" ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be separated into a different script. ( a hardhat script)

@blueogin blueogin Feb 2, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

Comment thread packages/bridge-contracts/scripts/oft/oft-deploy.ts Outdated
Comment thread packages/bridge-contracts/.env.sample Outdated
Comment thread packages/bridge-contracts/hardhat.config.ts Outdated
Comment thread packages/bridge-contracts/contracts/oft/GoodDollarOFTAdapter.sol
@openzeppelin-code

openzeppelin-code Bot commented Feb 2, 2026

Copy link
Copy Markdown

Feature: oft adapter step3 - deploy script and test

Generated at commit: 5ce02f8fc989ad34526ce7de6ce5e4fbc33ae4eb

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
1
0
9
37
47
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Comment thread packages/bridge-contracts/scripts/oft/oft-deploy.ts Outdated
Comment thread packages/bridge-contracts/scripts/oft/oft-deploy.ts Outdated
Comment thread packages/bridge-contracts/test/oft/OFT_CONFIGURING_GUIDE.md
Comment thread packages/bridge-contracts/contracts/oft/GoodDollarOFTAdapter.sol Outdated
Comment thread packages/bridge-contracts/contracts/oft/GoodDollarOFTAdapter.sol Outdated
…te request approval mechanism to use bytes32 IDs, and implement request ID generation for improved limit management
…oved clarity, implement request approval checks, and enforce limits on sending and receiving functions
…8.9 with optimizer settings and modify LayerZero config to reference the correct deployment file
…ove legacy deployment script; add set-oft-operator script for DAO governance integration
…across deployment scripts, tests, and documentation for consistency and clarity in cross-chain token management
@blueogin blueogin requested a review from sirpy March 19, 2026 16:17
@blueogin

Copy link
Copy Markdown
Collaborator Author

Hi @sirpy
Could you please review?

@blueogin

Copy link
Copy Markdown
Collaborator Author

@sirpy
Could you please review?

…apter and GoodDollarOFTMinterBurner contracts to prevent zero address assignments, enhancing contract security and reliability
@sirpy

sirpy commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

@copilot please audit the contracts and also review the deployment scripts

Copilot AI and others added 2 commits April 19, 2026 11:05
…e, use avatar as feeRecipient, clean up dead code

Agent-Logs-Url: https://github.com/GoodDollar/GoodBridge/sessions/ec1dcb51-cab6-414e-8579-666c2c266a65

Co-authored-by: sirpy <671095+sirpy@users.noreply.github.com>

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

@copilot please audit the contracts and also review the deployment scripts

Audit completed (commit 47271d8). Here are the findings:

GoodDollarOFTAdapter.sol bugs fixed:

  1. Tautology check removedrequire(decimals() == decimals(), 'token decimals mismatch') was always true and removed.
  2. _credit return value fixed – was returning _amountLD (gross amount) instead of recipientAmount (net after fees). This caused the OFTReceived event to report the incorrect received amount whenever bridge fees were charged.

deployOFT.ts fix:
3. feeRecipient corrected – was initializing feeRecipient to the deployer address (root.address); now correctly uses avatarAddress (DAO Avatar).

set-bridge-limits.ts cleanup:
4. Dead code removed – unused Controller contract instantiation and commented-out abiCoder were removed. Updated misleading comment about Controller/Avatar execution.

No issues found in GoodDollarOFTMinterBurner.sol. Access control, pause/unpause, and operator management are correctly restricted to the DAO avatar.

Other items reviewed (no changes needed):

  • _authorizeUpgrade correctly uses onlyOwner with no emit (UUPS pattern ✅)
  • approveFailedRequest optimistic window (3 days) and owner override are correct
  • Bridge limit checks and daily reset logic are correct
  • UUPS upgradeable pattern is implemented correctly

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • binaries.soliditylang.org
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 odul�� unset --global k/_temp/copilot-developer-action-main/dist/gh-gpgsign/gh-gpgsignlocalhost;localhost:*;127.0.0.1;--noprofile credential.usernbash (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node node_modules/.bin/hardhat test test/GoodDollarOFT.test.ts conf�� le.encode(&#39;utf-8&#39;)); --global e_modules/.bin/sh user.name (dns block)
  • ethereum.github.io
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 odul�� unset --global k/_temp/copilot-developer-action-main/dist/gh-gpgsign/gh-gpgsignlocalhost;localhost:*;127.0.0.1;--noprofile credential.usernbash (dns block)
  • relay.trufflesuite.com
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 odul�� unset --global k/_temp/copilot-developer-action-main/dist/gh-gpgsign/gh-gpgsignlocalhost;localhost:*;127.0.0.1;--noprofile credential.usernbash (dns block)
  • solc-bin.ethereum.org
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 odul�� unset --global k/_temp/copilot-developer-action-main/dist/gh-gpgsign/gh-gpgsignlocalhost;localhost:*;127.0.0.1;--noprofile credential.usernbash (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from sirpy April 19, 2026 11:08
@sirpy

sirpy commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

@blueogin please verify the AI fixes, does the decimals check need an alternative?

@sirpy

sirpy commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

@copilot create the copilot-setup-steps.yml file so you can run hardhat correctly

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

@copilot create the copilot-setup-steps.yml file so you can run hardhat correctly

Created .github/workflows/copilot-setup-steps.yml (commit 5ce02f8). The setup:

  1. Installs Node.js 20 via actions/setup-node
  2. Installs root dependencies using the bundled yarn-4.6.0.cjs from the repo
  3. Installs bridge-contracts node_modules explicitly — needed because the root uses Yarn PnP while packages/bridge-contracts/.yarnrc.yml uses nodeLinker: node-modules, so a workspace-specific install is required to populate packages/bridge-contracts/node_modules/
  4. Pre-compiles contracts with hardhat compile — this downloads and caches the Solidity 0.8.22 and 0.8.10 compiler binaries into ~/.cache/hardhat-nodejs/ before Copilot starts working, which is necessary because the agent's network firewall blocks downloads to binaries.soliditylang.org

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • binaries.soliditylang.org
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node node_modules/.bin/hardhat compile (dns block)
  • ethereum.github.io
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • relay.trufflesuite.com
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)
  • solc-bin.ethereum.org
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/zlib -I /home/REDACTED/.cache/node-gyp/24.14.1/deps/v8/include -I ../../nan -imultiarch x86_64-linux-gnu (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./build/cli.bundled.js obtain --solc=0.5.16 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@blueogin

Copy link
Copy Markdown
Collaborator Author

@sirpy
Could you please review?

# Use the bundled Yarn from the repository (.yarn/releases/yarn-4.6.0.cjs)
# so the correct version is always used without relying on corepack downloads.
- name: Install root dependencies
run: node .yarn/releases/yarn-4.6.0.cjs install

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isnt using yarn?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change copilot-setup-steps.yml to use yarn


# bridge-contracts uses nodeLinker: node-modules (its own .yarnrc.yml) while the root
# uses PnP, so the workspace needs its own node_modules populated explicitly.
- name: Install bridge-contracts node_modules

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is he talking about pnpm?
why does it need to install bridge-contracts? thats the current source code its working on

# are blocked by the agent's network firewall.
- name: Pre-download Solidity compilers
working-directory: packages/bridge-contracts
run: node_modules/.bin/hardhat compile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not simply yarn hardhat compile

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it

@sirpy

sirpy commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

@blueogin did you code review the AI fixes?

@blueogin

Copy link
Copy Markdown
Collaborator Author

@sirpy yes - I reviewed the code generated by AI, but I missed the changes related to GitHub Actions.

@blueogin blueogin changed the base branch from feat/oft-adapter-step2 to master April 29, 2026 16:51
@blueogin blueogin merged commit bfdcade into master Apr 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants