Skip to content
Open
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
8 changes: 5 additions & 3 deletions script/broker/deploy_broker.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ contract DeployLendingBroker is DeployBase {
console.log("Deployer: ", deployer);
vm.startBroadcast(deployerPrivateKey);

// Deploy LendingBroker implementation
LendingBroker impl = new LendingBroker(moolah, interestRelayer, oracle, wbnb);
// Deploy LendingBroker implementation (single impl shared across all proxies)
LendingBroker impl = new LendingBroker(moolah, wbnb);
console.log("LendingBroker implementation: ", address(impl));

// Deploy LendingBroker proxy
Expand All @@ -51,7 +51,9 @@ contract DeployLendingBroker is DeployBase {
bot,
pauser,
rateCalculator,
maxFixedLoanPositions
maxFixedLoanPositions,
interestRelayer,
oracle
)
);
console.log("LendingBroker proxy: ", address(proxy));
Expand Down
18 changes: 5 additions & 13 deletions script/broker/deploy_brokerImpl.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ contract DeployLendingBrokerImpl is DeployBase {
0xc26CaAcb00854c5460030B0aFde60C37D9d39C79,
0x3ade951523e81dD45e5787bb0b95Ce7341Db1287
];
address moolah;
address wbnb;

function setUp() public {
moolah = vm.envAddress("MOOLAH");
wbnb = vm.envOr("WBNB", address(0));
}

Expand All @@ -48,19 +50,9 @@ contract DeployLendingBrokerImpl is DeployBase {

vm.startBroadcast(deployerPrivateKey);

for (uint256 i = 0; i < brokers.length; i++) {
address payable proxy = payable(brokers[i]);

// Read constructor params from the existing proxy contract
address _moolah = address(LendingBroker(proxy).MOOLAH());
address _relayer = LendingBroker(proxy).RELAYER();
address _oracle = address(LendingBroker(proxy).ORACLE());

// Deploy LendingBroker implementation
LendingBroker impl = new LendingBroker(_moolah, _relayer, _oracle, wbnb);
console.log("Broker proxy:", proxy);
console.log(" New impl: ", address(impl));
}
// Deploy LendingBroker implementation
LendingBroker impl = new LendingBroker(moolah, wbnb);
console.log("LendingBroker implementation: ", address(impl));

vm.stopBroadcast();
}
Expand Down
2 changes: 1 addition & 1 deletion script/broker/deploy_broker_20260408.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ contract DeployXautBrokers is DeployBase {

function _deployBroker(string memory label, address relayer, address oracle, address deployer) internal {
// Deploy implementation
LendingBroker impl = new LendingBroker(MOOLAH, relayer, oracle, address(0));
LendingBroker impl = new LendingBroker(MOOLAH, address(0));
console.log(string.concat("LendingBroker(", label, ") impl: "), address(impl));

// Deploy proxy
Expand Down
Loading
Loading