Skip to content

Commit b46a5e8

Browse files
committed
feat: enhance deployment script for ListaRevenueDistributor with chain-specific addresses
1 parent 07497a7 commit b46a5e8

1 file changed

Lines changed: 26 additions & 14 deletions

File tree

scripts/foundry/eth/deploy_listaRevenueDistributor.sol

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,45 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
55
import { ListaRevenueDistributor } from "../../../contracts/dao/ListaRevenueDistributor.sol";
66

77
/**
8-
* @dev ETH mainnet deployment script for ListaRevenueDistributor
8+
* @dev Deployment script for ListaRevenueDistributor (ETH / Sepolia)
99
*
10-
* Fee flow: Moolah → LendingFeeRecipient(0xd10a024602E042dcb9C19e21682c3b896c8B0d30) → ListaRevenueDistributor (this contract)
11-
* Revenue accumulates here, MANAGER calls emergencyWithdraw() for cross-chain bridging to BSC
10+
* Run (Sepolia):
11+
* source .env && forge script scripts/foundry/eth/deploy_listaRevenueDistributor.sol \
12+
* --rpc-url $SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY
1213
*
13-
* After deployment:
14-
* 1. Record this proxy address
15-
* 2. Fill it into MarketFactory deploy script (listaRevenueDistributor param)
16-
* 3. Call LendingFeeRecipient(0xd10a024602E042dcb9C19e21682c3b896c8B0d30).setMarketFeeRecipient(this proxy address)
17-
*
18-
* Run:
19-
* forge script scripts/foundry/eth/deploy_listaRevenueDistributor.sol --rpc-url eth --broadcast --verify
14+
* Run (ETH mainnet):
15+
* source .env && forge script scripts/foundry/eth/deploy_listaRevenueDistributor.sol \
16+
* --rpc-url $ETHEREUM_RPC --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY
2017
*/
2118
contract ListaRevenueDistributorDeploy is Script {
19+
function _deployerKey() internal view returns (uint256) {
20+
if (block.chainid == 11155111) return vm.envUint("PRIVATE_KEY_TESTNET"); // Sepolia
21+
return vm.envUint("PRIVATE_KEY"); // Ethereum mainnet
22+
}
23+
2224
function run() public {
23-
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
25+
uint256 deployerPrivateKey = _deployerKey();
2426
address deployer = vm.addr(deployerPrivateKey);
2527
console.log("Deployer: ", deployer);
2628

27-
// ETH mainnet addresses
28-
address manager = 0x8d388136d578dCD791D081c6042284CED6d9B0c6; // Manager Safe
29-
address listaAddress = 0xFceB31A79F71AC9CBDCF853519c1b12D379EdC46; // TODO: replace with real LISTA token address on ETH mainnet
29+
// Addresses based on chain
30+
address manager;
31+
address listaAddress;
3032
address autoBuybackAddress = address(0); // not used on ETH
3133
address revenueWalletAddress = address(0); // not used on ETH
3234
address listaDistributeToAddress = address(0); // not used on ETH
3335
uint128 distributeRate = 700000000000000000; // 70%
3436

37+
if (block.chainid == 11155111) {
38+
// Sepolia testnet
39+
manager = deployer;
40+
listaAddress = 0xFceB31A79F71AC9CBDCF853519c1b12D379EdC46; // placeholder (non-zero required by initialize)
41+
} else {
42+
// ETH mainnet
43+
manager = 0x8d388136d578dCD791D081c6042284CED6d9B0c6; // Manager Safe
44+
listaAddress = 0xFceB31A79F71AC9CBDCF853519c1b12D379EdC46; // TODO: replace with real LISTA token address on ETH mainnet
45+
}
46+
3547
vm.startBroadcast(deployerPrivateKey);
3648

3749
// Deploy implementation

0 commit comments

Comments
 (0)