Skip to content

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

"registry": "0x44a1E0A83821E239F9Cef248CECc3AC5b910aeD2"
},
"development-celo": {
"GoodDollarMinterBurner": "0x3850786C7627Ce276EF6F715a0eF31d5FeCf1fc7",
Copy link
Contributor

Choose a reason for hiding this comment

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

use diffrenet file for oft

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

# 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.

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


// Encode the initialize function call
const initializeInterface = OFTAdapterFactory.interface;
const initializeData = initializeInterface.encodeFunctionData("initialize", [
Copy link
Contributor

Choose a reason for hiding this comment

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

not used

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will remove it
It's not required anymore

@@ -0,0 +1,21 @@
ONLY_WHITELISTED= # Whether only whitelisted addresses can bridge
Copy link
Contributor

Choose a reason for hiding this comment

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

use json with network-env keys

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure

},
contractSizer: {
runOnCompile: true,
runOnCompile: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

why disabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because it was a bit frustrating to work with, I’ll revert it.

}

/// @dev Struct for storing account limits
struct AccountLimit {
Copy link
Contributor

Choose a reason for hiding this comment

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

all of the fees and limits changes should have been applied on the step2 PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will move it to step2 PR

@openzeppelin-code
Copy link

openzeppelin-code bot commented Feb 2, 2026

Feature: oft adapter step3 - deploy script and test

Generated at commit: c5b45dfa03a3061d626c9d81b21b686220b8fb0b

🚨 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

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