Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m21s
CI/CD Pipeline / Security Scanning (push) Successful in 2m33s
CI/CD Pipeline / Lint and Format (push) Failing after 38s
CI/CD Pipeline / Terraform Validation (push) Failing after 24s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 24s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 37s
Validation / validate-genesis (push) Successful in 29s
Validation / validate-terraform (push) Failing after 27s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m13s
Validation / validate-documentation (push) Failing after 17s
Verify Deployment / Verify Deployment (push) Failing after 52s
WireDBISRailPostDeploy/Signers forge scripts, PMM pool registry, and explorer verify refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
90 lines
3.1 KiB
Solidity
90 lines
3.1 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
import "forge-std/Script.sol";
|
|
import "../../contracts/dbis/DBIS_ParticipantRegistry.sol";
|
|
import "../../contracts/dbis/DBIS_GRU_MintController.sol";
|
|
import "../../contracts/dbis/StablecoinReferenceRegistry.sol";
|
|
|
|
/**
|
|
* @title WireDBISRailPostDeploy
|
|
* @notice Post-deploy wiring: stablecoin registry, optional GRU token, seed participants.
|
|
* @dev Env: PRIVATE_KEY; contract addresses from deploy report or env DBIS_* vars.
|
|
*/
|
|
contract WireDBISRailPostDeploy is Script {
|
|
function run() external {
|
|
uint256 pk = vm.envUint("PRIVATE_KEY");
|
|
address admin = vm.envOr("ADMIN_ADDRESS", vm.addr(pk));
|
|
|
|
address stableRegAddr = vm.envAddress("DBIS_STABLECOIN_REGISTRY");
|
|
address mintCtrlAddr = vm.envAddress("DBIS_GRU_MINT_CONTROLLER");
|
|
address participantRegAddr = vm.envAddress("DBIS_PARTICIPANT_REGISTRY");
|
|
|
|
StablecoinReferenceRegistry stableReg = StablecoinReferenceRegistry(stableRegAddr);
|
|
DBIS_GRU_MintController mintController = DBIS_GRU_MintController(mintCtrlAddr);
|
|
DBIS_ParticipantRegistry participantReg = DBIS_ParticipantRegistry(participantRegAddr);
|
|
|
|
vm.startBroadcast(pk);
|
|
|
|
_registerStablecoin(
|
|
stableReg,
|
|
vm.envAddress("CUSDT_ADDRESS"),
|
|
"cUSDT",
|
|
admin
|
|
);
|
|
_registerStablecoin(
|
|
stableReg,
|
|
vm.envAddress("CUSDC_ADDRESS"),
|
|
"cUSDC",
|
|
admin
|
|
);
|
|
|
|
address gruToken = vm.envOr("DBIS_GRU_MINTABLE_TOKEN", address(0));
|
|
if (gruToken != address(0)) {
|
|
mintController.setGruToken(gruToken);
|
|
}
|
|
|
|
bytes32 participantId = keccak256("OMNL-OPERATOR");
|
|
DBIS_ParticipantRegistry.Participant memory existing = participantReg.getParticipant(participantId);
|
|
if (existing.participantId == bytes32(0)) {
|
|
address[] memory wallets = new address[](1);
|
|
wallets[0] = admin;
|
|
bytes32[] memory tags = new bytes32[](0);
|
|
participantReg.registerParticipant(
|
|
DBIS_ParticipantRegistry.Participant({
|
|
participantId: participantId,
|
|
legalName: "OMNL Fineract Operator",
|
|
jurisdiction: "MULTI",
|
|
entityType: DBIS_ParticipantRegistry.EntityType.OPERATOR,
|
|
status: DBIS_ParticipantRegistry.Status.ACTIVE,
|
|
policyTags: tags,
|
|
operationalWallets: wallets
|
|
})
|
|
);
|
|
}
|
|
|
|
vm.stopBroadcast();
|
|
}
|
|
|
|
function _registerStablecoin(
|
|
StablecoinReferenceRegistry reg,
|
|
address token,
|
|
string memory symbol,
|
|
address pauseAuthority
|
|
) private {
|
|
if (token == address(0)) return;
|
|
StablecoinReferenceRegistry.StablecoinEntry memory existing = reg.getEntry(token);
|
|
if (existing.exists) return;
|
|
reg.register(
|
|
token,
|
|
symbol,
|
|
"DBIS",
|
|
"compliant_stable",
|
|
"omnl_redeem",
|
|
"EXPLORER_TOKEN_LIST_CROSSCHECK",
|
|
1,
|
|
pauseAuthority
|
|
);
|
|
}
|
|
}
|