Commit c6cd795f authored by tre's avatar tre

Configure scripts for drippie

parent 4d5375b0
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0x636Af16bf2f682dD3109e60102b8E1A089FedAa8",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
...@@ -20,5 +20,19 @@ ...@@ -20,5 +20,19 @@
"faucetOnchainAuthModuleAmount": 1000000000000000000, "faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC", "faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400, "faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000 "faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": false,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
} }
{
"faucetAdmin": "0x212E789D4523D4BAF464f8Fb2A9B9dff2B36e5A6",
"faucetDrippieOwner": "0x10ab157483dd308f8B38aCF2ad823dfD255F56b5",
"faucetDripV1Value": 20000000000000000000,
"faucetDripV1Interval": 3600,
"faucetDripV1Threshold": 100000000000000000000,
"faucetDripV2Interval": 604800,
"faucetDripV2Threshold": 20000000000000000000,
"faucetDripV2Value": 500000000000000000000,
"faucetAdminDripV1Interval": 86400,
"faucetAdminDripV1Threshold": 100000000000000000,
"faucetAdminDripV1Value": 1000000000000000000,
"faucetGelatoTreasury": "0x644CB00854EDC55FE8CCC9c1967BABb22F08Ad2f",
"faucetGelatoRecipient": "0x0E9b4649eB0760A4F01646636E032D68cFDe58FF",
"faucetGelatoBalanceV1DripInterval": 86400,
"faucetGelatoBalanceV1Value": 1000000000000000000,
"faucetGelatoThreshold": 100000000000000000,
"faucetOnchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOnchainAuthModuleTtl": 86400,
"faucetOnchainAuthModuleAmount": 1000000000000000000,
"faucetOffchainAuthModuleAdmin": "0xFe44Ae787A632c45ACea658492dDBebE39f002aC",
"faucetOffchainAuthModuleTtl": 86400,
"faucetOffchainAuthModuleAmount": 50000000000000000,
"opL1BridgeAddress": "0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1",
"pgnL1BridgeAddress": "0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3",
"zoraL1BridgeAddress": "0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB",
"orderlyL1BridgeAddress": "0x1Af0494040d6904A9F3EE21921de4b359C736333",
"modeL1BridgeAddress": "0xbC5C679879B2965296756CD959C3C739769995E2",
"lyraL1BridgeAddress": "0x915f179A77FB2e1AeA8b56Ebc0D75A7e1A8a7A17",
"installOpChainFaucetsDrips": true,
"dripVersion": 1,
"smallOpChainFaucetDripValue": 2000000000000000000,
"smallOpChainFaucetDripInterval": 86400,
"largeOpChainFaucetDripValue": 34000000000000000000,
"largeOpChainFaucetDripInterval": 86400,
"opChainAdminWalletDripValue": 1000000000000000000,
"opChainAdminWalletDripInterval": 2592000
}
...@@ -47,6 +47,10 @@ contract DeployPeriphery is Deployer { ...@@ -47,6 +47,10 @@ contract DeployPeriphery is Deployer {
initializeFaucet(); initializeFaucet();
installFaucetAuthModulesConfigs(); installFaucetAuthModulesConfigs();
if (cfg.installOpChainFaucetsDrips()) {
installOpChainFaucetsDrippieConfigs();
}
} }
/// @notice Deploy all of the proxies /// @notice Deploy all of the proxies
...@@ -264,6 +268,180 @@ contract DeployPeriphery is Deployer { ...@@ -264,6 +268,180 @@ contract DeployPeriphery is Deployer {
console.log("Faucet drip configs successfully installed"); console.log("Faucet drip configs successfully installed");
} }
/// @notice installs drip configs that deposit funds to all OP Chain faucets. This function
/// should only be called on an L1 testnet.
function installOpChainFaucetsDrippieConfigs() public {
uint256 drippieOwnerPrivateKey = vm.envUint("DRIPPIE_OWNER_PRIVATE_KEY");
vm.startBroadcast(drippieOwnerPrivateKey);
Drippie drippie = Drippie(mustGetAddress("FaucetDrippie"));
console.log("Installing OP Chain faucet drips at %s", address(drippie));
installSmallOpChainFaucetsDrips();
installLargeOpChainFaucetsDrips();
installSmallOpChainAdminWalletDrips();
installLargeOpChainAdminWalletDrips();
vm.stopBroadcast();
console.log("OP chain faucet drip configs successfully installed");
}
/// @notice installs drips that send funds to small OP chain faucets on the scheduled interval.
function installSmallOpChainFaucetsDrips() public {
Drippie drippie = Drippie(mustGetAddress("FaucetDrippie"));
address faucetProxy = mustGetAddress("FaucetProxy");
uint256 arrayLength = cfg.getSmallFaucetsL1BridgeAddressesCount();
for (uint256 i = 0; i < arrayLength; i++) {
address l1BridgeAddress = cfg.smallFaucetsL1BridgeAddresses(i);
string memory dripNamePrefix = string.concat("faucet-drip-", vm.toString(l1BridgeAddress));
string memory versionSuffix = string.concat("-", vm.toString(cfg.dripVersion()));
string memory dripName = string.concat(dripNamePrefix, versionSuffix);
if (drippie.getDripStatus(dripName) == Drippie.DripStatus.NONE) {
console.log("installing %s", dripName);
Drippie.DripAction[] memory actions = new Drippie.DripAction[](1);
actions[0] = Drippie.DripAction({
target: payable(l1BridgeAddress),
data: abi.encodeWithSignature("depositETHTo(address,uint32,bytes)", faucetProxy, 200000, ""),
value: cfg.smallOpChainFaucetDripValue()
});
drippie.create({
_name: dripName,
_config: Drippie.DripConfig({
reentrant: false,
interval: cfg.smallOpChainFaucetDripInterval(),
dripcheck: CheckTrue(mustGetAddress("CheckTrue")),
checkparams: abi.encode(""),
actions: actions
})
});
console.log("%s installed successfully", dripName);
} else {
console.log("%s already installed.", dripName);
}
_activateIfPausedDrip(drippie, dripName);
}
}
/// @notice installs drips that send funds to small OP chain faucets on the scheduled interval.
function installSmallOpChainAdminWalletDrips() public {
Drippie drippie = Drippie(mustGetAddress("FaucetDrippie"));
require(
cfg.faucetOnchainAuthModuleAdmin() == cfg.faucetOffchainAuthModuleAdmin(),
"installSmallOpChainAdminWalletDrips: Only handles identical admin wallet addresses"
);
address adminWallet = cfg.faucetOnchainAuthModuleAdmin();
uint256 arrayLength = cfg.getSmallFaucetsL1BridgeAddressesCount();
for (uint256 i = 0; i < arrayLength; i++) {
address l1BridgeAddress = cfg.smallFaucetsL1BridgeAddresses(i);
string memory dripNamePrefix = string.concat("faucet-admin-drip-", vm.toString(l1BridgeAddress));
string memory versionSuffix = string.concat("-", vm.toString(cfg.dripVersion()));
string memory dripName = string.concat(dripNamePrefix, versionSuffix);
if (drippie.getDripStatus(dripName) == Drippie.DripStatus.NONE) {
console.log("installing %s", dripName);
Drippie.DripAction[] memory actions = new Drippie.DripAction[](1);
actions[0] = Drippie.DripAction({
target: payable(l1BridgeAddress),
data: abi.encodeWithSignature("depositETHTo(address,uint32,bytes)", adminWallet, 200000, ""),
value: cfg.opChainAdminWalletDripValue()
});
drippie.create({
_name: dripName,
_config: Drippie.DripConfig({
reentrant: false,
interval: cfg.opChainAdminWalletDripInterval(),
dripcheck: CheckTrue(mustGetAddress("CheckTrue")),
checkparams: abi.encode(""),
actions: actions
})
});
console.log("%s installed successfully", dripName);
} else {
console.log("%s already installed.", dripName);
}
_activateIfPausedDrip(drippie, dripName);
}
}
/// @notice installs drips that send funds to small OP chain faucets on the scheduled interval.
function installLargeOpChainAdminWalletDrips() public {
Drippie drippie = Drippie(mustGetAddress("FaucetDrippie"));
require(
cfg.faucetOnchainAuthModuleAdmin() == cfg.faucetOffchainAuthModuleAdmin(),
"installLargeOpChainAdminWalletDrips: Only handles identical admin wallet addresses"
);
address adminWallet = cfg.faucetOnchainAuthModuleAdmin();
uint256 arrayLength = cfg.getLargeFaucetsL1BridgeAddressesCount();
for (uint256 i = 0; i < arrayLength; i++) {
address l1BridgeAddress = cfg.largeFaucetsL1BridgeAddresses(i);
string memory dripNamePrefix = string.concat("faucet-admin-drip-", vm.toString(l1BridgeAddress));
string memory versionSuffix = string.concat("-", vm.toString(cfg.dripVersion()));
string memory dripName = string.concat(dripNamePrefix, versionSuffix);
if (drippie.getDripStatus(dripName) == Drippie.DripStatus.NONE) {
console.log("installing %s", dripName);
Drippie.DripAction[] memory actions = new Drippie.DripAction[](1);
actions[0] = Drippie.DripAction({
target: payable(l1BridgeAddress),
data: abi.encodeWithSignature("depositETHTo(address,uint32,bytes)", adminWallet, 200000, ""),
value: cfg.opChainAdminWalletDripValue()
});
drippie.create({
_name: dripName,
_config: Drippie.DripConfig({
reentrant: false,
interval: cfg.opChainAdminWalletDripInterval(),
dripcheck: CheckTrue(mustGetAddress("CheckTrue")),
checkparams: abi.encode(""),
actions: actions
})
});
console.log("%s installed successfully", dripName);
} else {
console.log("%s already installed.", dripName);
}
_activateIfPausedDrip(drippie, dripName);
}
}
/// @notice installs drips that send funds to large OP chain faucets on the scheduled interval.
function installLargeOpChainFaucetsDrips() public {
Drippie drippie = Drippie(mustGetAddress("FaucetDrippie"));
address faucetProxy = mustGetAddress("FaucetProxy");
uint256 arrayLength = cfg.getLargeFaucetsL1BridgeAddressesCount();
for (uint256 i = 0; i < arrayLength; i++) {
address l1BridgeAddress = cfg.largeFaucetsL1BridgeAddresses(i);
string memory dripNamePrefix = string.concat("faucet-drip-", vm.toString(l1BridgeAddress));
string memory versionSuffix = string.concat("-", vm.toString(cfg.dripVersion()));
string memory dripName = string.concat(dripNamePrefix, versionSuffix);
if (drippie.getDripStatus(dripName) == Drippie.DripStatus.NONE) {
console.log("installing %s", dripName);
Drippie.DripAction[] memory actions = new Drippie.DripAction[](1);
actions[0] = Drippie.DripAction({
target: payable(l1BridgeAddress),
data: abi.encodeWithSignature("depositETHTo(address,uint32,bytes)", faucetProxy, 200000, ""),
value: cfg.smallOpChainFaucetDripValue()
});
drippie.create({
_name: dripName,
_config: Drippie.DripConfig({
reentrant: false,
interval: cfg.smallOpChainFaucetDripInterval(),
dripcheck: CheckTrue(mustGetAddress("CheckTrue")),
checkparams: abi.encode(""),
actions: actions
})
});
console.log("%s installed successfully", dripName);
} else {
console.log("%s already installed.", dripName);
}
_activateIfPausedDrip(drippie, dripName);
}
}
/// @notice installs the FaucetDripV1 drip on the faucet drippie contract. /// @notice installs the FaucetDripV1 drip on the faucet drippie contract.
function installFaucetDripV1() public broadcast { function installFaucetDripV1() public broadcast {
Drippie drippie = Drippie(mustGetAddress("FaucetDrippie")); Drippie drippie = Drippie(mustGetAddress("FaucetDrippie"));
......
...@@ -34,6 +34,22 @@ contract PeripheryDeployConfig is Script { ...@@ -34,6 +34,22 @@ contract PeripheryDeployConfig is Script {
address public faucetOffchainAuthModuleAdmin; address public faucetOffchainAuthModuleAdmin;
uint256 public faucetOffchainAuthModuleTtl; uint256 public faucetOffchainAuthModuleTtl;
uint256 public faucetOffchainAuthModuleAmount; uint256 public faucetOffchainAuthModuleAmount;
bool public installOpChainFaucetsDrips;
uint256 public smallOpChainFaucetDripValue;
uint256 public smallOpChainFaucetDripInterval;
uint256 public largeOpChainFaucetDripValue;
uint256 public largeOpChainFaucetDripInterval;
uint256 public opChainAdminWalletDripValue;
uint256 public opChainAdminWalletDripInterval;
address public opL1BridgeAddress;
address public zoraL1BridgeAddress;
address public pgnL1BridgeAddress;
address public orderlyL1BridgeAddress;
address public modeL1BridgeAddress;
address public lyraL1BridgeAddress;
address[5] public smallFaucetsL1BridgeAddresses;
address[1] public largeFaucetsL1BridgeAddresses;
uint256 public dripVersion;
constructor(string memory _path) { constructor(string memory _path) {
console.log("PeripheryDeployConfig: reading file %s", _path); console.log("PeripheryDeployConfig: reading file %s", _path);
...@@ -66,5 +82,33 @@ contract PeripheryDeployConfig is Script { ...@@ -66,5 +82,33 @@ contract PeripheryDeployConfig is Script {
faucetOffchainAuthModuleAdmin = stdJson.readAddress(_json, "$.faucetOffchainAuthModuleAdmin"); faucetOffchainAuthModuleAdmin = stdJson.readAddress(_json, "$.faucetOffchainAuthModuleAdmin");
faucetOffchainAuthModuleTtl = stdJson.readUint(_json, "$.faucetOffchainAuthModuleTtl"); faucetOffchainAuthModuleTtl = stdJson.readUint(_json, "$.faucetOffchainAuthModuleTtl");
faucetOffchainAuthModuleAmount = stdJson.readUint(_json, "$.faucetOffchainAuthModuleAmount"); faucetOffchainAuthModuleAmount = stdJson.readUint(_json, "$.faucetOffchainAuthModuleAmount");
installOpChainFaucetsDrips = stdJson.readBool(_json, "$.installOpChainFaucetsDrips");
opL1BridgeAddress = stdJson.readAddress(_json, "$.opL1BridgeAddress");
zoraL1BridgeAddress = stdJson.readAddress(_json, "$.zoraL1BridgeAddress");
pgnL1BridgeAddress = stdJson.readAddress(_json, "$.pgnL1BridgeAddress");
orderlyL1BridgeAddress = stdJson.readAddress(_json, "$.orderlyL1BridgeAddress");
modeL1BridgeAddress = stdJson.readAddress(_json, "$.modeL1BridgeAddress");
lyraL1BridgeAddress = stdJson.readAddress(_json, "$.lyraL1BridgeAddress");
dripVersion = stdJson.readUint(_json, "$.dripVersion");
smallOpChainFaucetDripValue = stdJson.readUint(_json, "$.smallOpChainFaucetDripValue");
smallOpChainFaucetDripInterval = stdJson.readUint(_json, "$.smallOpChainFaucetDripInterval");
largeOpChainFaucetDripValue = stdJson.readUint(_json, "$.largeOpChainFaucetDripValue");
largeOpChainFaucetDripInterval = stdJson.readUint(_json, "$.largeOpChainFaucetDripInterval");
opChainAdminWalletDripValue = stdJson.readUint(_json, "$.opChainAdminWalletDripValue");
opChainAdminWalletDripInterval = stdJson.readUint(_json, "$.opChainAdminWalletDripInterval");
largeFaucetsL1BridgeAddresses[0] = opL1BridgeAddress;
smallFaucetsL1BridgeAddresses[0] = zoraL1BridgeAddress;
smallFaucetsL1BridgeAddresses[1] = pgnL1BridgeAddress;
smallFaucetsL1BridgeAddresses[2] = orderlyL1BridgeAddress;
smallFaucetsL1BridgeAddresses[3] = modeL1BridgeAddress;
smallFaucetsL1BridgeAddresses[4] = lyraL1BridgeAddress;
}
function getSmallFaucetsL1BridgeAddressesCount() public view returns (uint256 count) {
return smallFaucetsL1BridgeAddresses.length;
}
function getLargeFaucetsL1BridgeAddressesCount() public view returns (uint256 count) {
return largeFaucetsL1BridgeAddresses.length;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment