Skip to content

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

Open
blueogin wants to merge 33 commits intofeat/oft-adapter-step2from
feat/oft-adatper-step3
Open

Feature: oft adapter step3 - deploy script and test#11
blueogin wants to merge 33 commits intofeat/oft-adapter-step2from
feat/oft-adatper-step3

Conversation

@blueogin
Copy link
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
Copy link

@sourcery-ai sourcery-ai bot left a comment

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
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {
// Authorization is handled by onlyOwner modifier
// Additional checks can be added here if needed
emit AuthorizedUpgrade(newImplementation);
Copy link
Contributor

Choose a reason for hiding this comment

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

no required

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, It was required for UUPSUpgradeable contract.
I will use transparent model and remove that function

Copy link
Contributor

Choose a reason for hiding this comment

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

i ment that the emit event is not requred. we should use uups

# 6. Test bridge functionality (optional, last step)
#
# Usage:
# ./scripts/multichain-deploy/oft/configure-oft-xdc-celo.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

In general scripts should be hardhat scripts in typescript. not shell.

  1. the script should configure a single network ie configure-oft.ts --network development-xdc
  2. the script should be a hardhat script so --network is available
  3. all config values should be read from a json file ie oft.config.json (import config from './oft.config.json')
    where each network/env has its entry in the config file.

Copy link
Collaborator Author

@blueogin blueogin Feb 2, 2026

Choose a reason for hiding this comment

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

This file is rarely used in a production environment and is intended mainly as a reference.
Also, including all configuring logic into 1 script is not ideal I think
I’ll add an OFT_CONFIGURING_GUIDE file under scripts/oft to explain the configuration steps.

Copy link
Contributor

Choose a reason for hiding this comment

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

we use hadhat-deploy scripts , see messagepassingbridge

echo ""

# Step 7: Test bridge (optional, last step)
if [ "$SKIP_BRIDGE_TEST" != "true" ]; then
Copy link
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)

Copy link
Collaborator Author

@blueogin blueogin Feb 2, 2026

Choose a reason for hiding this comment

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

I see

@openzeppelin-code
Copy link

openzeppelin-code bot commented Feb 2, 2026

Feature: oft adapter step3 - deploy script and test

Generated at commit: 52284e0ccec3a15e0ddda9010d2e88c618bd0b2d

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
1
0
9
36
46
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

MinterBurner = await upgrades.deployProxy(
MinterBurnerFactory,
[nameServiceAddress],
{ kind: "uups", initializer: "initialize" }
Copy link
Contributor

Choose a reason for hiding this comment

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

i dont understand. why this was changed. we use uups

import fse from "fs-extra";
import Contracts from "@gooddollar/goodprotocol/releases/deployment.json";
import release from "../../release/deployment.json";
import release from "../../release/deployment-oft.json";
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we not using hardhat-deploy for deployment scripts


**Note**: Limit values can be specified in decimal format (e.g., "5000" for 5,000 G$). The scripts automatically convert them to wei (18 decimals).

## Manual Configuration: Step-by-Step
Copy link
Contributor

Choose a reason for hiding this comment

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

we should have a hardhat deploy script just like messagepassingbridge has

function _authorizeUpgrade(address newImplementation) internal override onlyOwner {
// Authorization is handled by onlyOwner modifier
// Additional checks can be added here if needed
emit AuthorizedUpgrade(newImplementation);
Copy link
Contributor

Choose a reason for hiding this comment

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

i ment that the emit event is not requred. we should use uups

import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { IMintableBurnable } from "@layerzerolabs/oft-evm/contracts/interfaces/IMintableBurnable.sol";
import { BridgeHelperLibrary } from "../messagePassingBridge/BridgeHelperLibrary.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm totally confused by this. in the other PRs you dont use bridgehelperlibrary.
you need to be consistent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IMessagePassingBridge and BridgeHelperLibrary imports are not necessary - will remove it

…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
…yment scripts for improved clarity and functionality
…est handling in GoodDollarOFTAdapter, enhancing error management and contract clarity
…on and update tests for new constructor argument
…ollarOFTAdapter with implementation address retrieval and verification functionality
…DollarOFTAdapter, and adjust bridging amount and transaction limits in configuration
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.

2 participants