Skip to content
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

xAccount config #14

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script/Proposal.s.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "./x-token/Config.s.sol";
import "./msgport/Connect.s.sol";

contract Proposal is ConfigScript {}
contract Proposal is ConnectScript {}
2 changes: 1 addition & 1 deletion script/common/Base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract contract Base is Script, Sphinx, SphinxConstants {

function configureSphinx() public override {
sphinxConfig.projectName = "RING-DAO";
sphinxConfig.testnets = ["darwinia_koi"];
sphinxConfig.testnets = ["sepolia", "arbitrum_sepolia"];
sphinxConfig.mainnets = ["ethereum", "darwinia"];
}

Expand Down
7 changes: 5 additions & 2 deletions script/msgport/Connect.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ contract ConnectScript is Base, OracleConfig, RelayerConfig {
Relayer relayer;
address ormpUpgradeablePort;
address multiPort;
address xAccountFactory;
address registry;

string[] networks;
Expand All @@ -42,6 +43,7 @@ contract ConnectScript is Base, OracleConfig, RelayerConfig {
ormpUpgradeablePort = deploy.ORMPUPORT();
multiPort = deploy.MULTIPORT();
registry = deploy.REGISTRY();
xAccountFactory = deploy.XACCOUNTFACTORY();
}

function init(uint256 local, string memory config) public override(OracleConfig, RelayerConfig) {
Expand Down Expand Up @@ -87,7 +89,7 @@ contract ConnectScript is Base, OracleConfig, RelayerConfig {
uint256 len = networks.length;
for (uint256 i = 0; i < len; i++) {
uint256 remoteChainId = getChainId(networks[i]);
// _setPortRegistry(remoteChainId);
_setPortRegistry(remoteChainId);
if (remoteChainId == localChainId) continue;
if (isSupported[remoteChainId]) {
_setOracleFee(localChainId, remoteChainId);
Expand Down Expand Up @@ -133,7 +135,8 @@ contract ConnectScript is Base, OracleConfig, RelayerConfig {

function _setPortRegistry(uint256 chainId) internal {
_setPortRegistry(ormpUpgradeablePort, chainId, "ORMP-U");
// _setPortRegistry(multiPort, chainId, "Multi");
_setPortRegistry(multiPort, chainId, "Multi");
_setPortRegistry(xAccountFactory, chainId, "xAccountFactory");
}

function _setPortRegistry(address port, uint256 chainId, string memory name) internal {
Expand Down
4 changes: 4 additions & 0 deletions script/msgport/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ contract DeployScript is Base {
return computeAddress(salt, hash(initCode));
}

function XACCOUNTFACTORY() public returns (address) {
return computeCreate3Address(salt);
}

function deployPortRegistry() internal {
bytes memory logicByteCode = type(PortRegistry).creationCode;
address logic = computeAddress(salt, hash(logicByteCode));
Expand Down
Loading