Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
42b8711b
Unverified
Commit
42b8711b
authored
Aug 14, 2024
by
smartcontracts
Committed by
GitHub
Aug 14, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update Sepolia Drippie config to latest (#10810)
parent
0d26ce63
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
382 additions
and
28 deletions
+382
-28
sepolia-faucet-bridges.json
...ploy-config-periphery/drippie/sepolia-faucet-bridges.json
+20
-0
sepolia-faucet-core.json
.../deploy-config-periphery/drippie/sepolia-faucet-core.json
+20
-0
sepolia-ops.json
...-bedrock/deploy-config-periphery/drippie/sepolia-ops.json
+35
-16
safe.json
packages/contracts-bedrock/safe.json
+155
-0
DrippieConfig.s.sol
...cts-bedrock/scripts/periphery/drippie/DrippieConfig.s.sol
+25
-7
ManageDrippie.s.sol
...cts-bedrock/scripts/periphery/drippie/ManageDrippie.s.sol
+3
-5
forge-to-safe-json.ts
...ages/contracts-bedrock/scripts/safe/forge-to-safe-json.ts
+124
-0
No files found.
packages/contracts-bedrock/deploy-config-periphery/drippie/sepolia-faucet-bridges.json
View file @
42b8711b
...
@@ -2,6 +2,26 @@
...
@@ -2,6 +2,26 @@
"drippie"
:
"0xd6F935Bd272BEE05bD64096D82970482EF16D64b"
,
"drippie"
:
"0xd6F935Bd272BEE05bD64096D82970482EF16D64b"
,
"gelato"
:
"0x859E31b3848Ec384012EECc72C5c49821008296C"
,
"gelato"
:
"0x859E31b3848Ec384012EECc72C5c49821008296C"
,
"__comment"
:
"Addresses of dripcheck contracts to be used in drips"
,
"dripchecks"
:
[
{
"00__name"
:
"CheckBalanceLow"
,
"01__address"
:
"0xaF8C77CfeB57620c4D9dCC81df75a1F0Da7064Af"
},
{
"00__name"
:
"CheckGelatoLow"
,
"01__address"
:
"0x0fF11AfAC4146a0bABf7F9F042a22C8053a54674"
},
{
"00__name"
:
"CheckSecrets"
,
"01__address"
:
"0x32c1e36E733913388076D7c3055300072814bF2A"
},
{
"00__name"
:
"CheckTrue"
,
"01__address"
:
"0xcBCb3896Ddec35d91901768733C5d3738e10509F"
}
],
"__comment"
:
"Prefix is used to namespace drips so that drip management can be handled modularly"
,
"__comment"
:
"Prefix is used to namespace drips so that drip management can be handled modularly"
,
"prefix"
:
"faucetbridged"
,
"prefix"
:
"faucetbridged"
,
...
...
packages/contracts-bedrock/deploy-config-periphery/drippie/sepolia-faucet-core.json
View file @
42b8711b
...
@@ -2,6 +2,26 @@
...
@@ -2,6 +2,26 @@
"drippie"
:
"0xd6F935Bd272BEE05bD64096D82970482EF16D64b"
,
"drippie"
:
"0xd6F935Bd272BEE05bD64096D82970482EF16D64b"
,
"gelato"
:
"0x859E31b3848Ec384012EECc72C5c49821008296C"
,
"gelato"
:
"0x859E31b3848Ec384012EECc72C5c49821008296C"
,
"__comment"
:
"Addresses of dripcheck contracts to be used in drips"
,
"dripchecks"
:
[
{
"00__name"
:
"CheckBalanceLow"
,
"01__address"
:
"0xaF8C77CfeB57620c4D9dCC81df75a1F0Da7064Af"
},
{
"00__name"
:
"CheckGelatoLow"
,
"01__address"
:
"0x0fF11AfAC4146a0bABf7F9F042a22C8053a54674"
},
{
"00__name"
:
"CheckSecrets"
,
"01__address"
:
"0x32c1e36E733913388076D7c3055300072814bF2A"
},
{
"00__name"
:
"CheckTrue"
,
"01__address"
:
"0xcBCb3896Ddec35d91901768733C5d3738e10509F"
}
],
"__comment"
:
"Prefix is used to namespace drips so that drip management can be handled modularly"
,
"__comment"
:
"Prefix is used to namespace drips so that drip management can be handled modularly"
,
"prefix"
:
"faucetcore"
,
"prefix"
:
"faucetcore"
,
...
...
packages/contracts-bedrock/deploy-config-periphery/drippie/sepolia-ops.json
View file @
42b8711b
...
@@ -2,13 +2,33 @@
...
@@ -2,13 +2,33 @@
"drippie"
:
"0xa0fF2a54AdC3fB33c44a141E67d194CF249258cb"
,
"drippie"
:
"0xa0fF2a54AdC3fB33c44a141E67d194CF249258cb"
,
"gelato"
:
"0x2A6C106ae13B558BB9E2Ec64Bd2f1f7BEFF3A5E0"
,
"gelato"
:
"0x2A6C106ae13B558BB9E2Ec64Bd2f1f7BEFF3A5E0"
,
"__comment"
:
"Addresses of dripcheck contracts to be used in drips"
,
"dripchecks"
:
[
{
"00__name"
:
"CheckBalanceLow"
,
"01__address"
:
"0xaF8C77CfeB57620c4D9dCC81df75a1F0Da7064Af"
},
{
"00__name"
:
"CheckGelatoLow"
,
"01__address"
:
"0x0fF11AfAC4146a0bABf7F9F042a22C8053a54674"
},
{
"00__name"
:
"CheckSecrets"
,
"01__address"
:
"0x32c1e36E733913388076D7c3055300072814bF2A"
},
{
"00__name"
:
"CheckTrue"
,
"01__address"
:
"0xcBCb3896Ddec35d91901768733C5d3738e10509F"
}
],
"__comment"
:
"Prefix is used to namespace drips so that drip management can be handled modularly"
,
"__comment"
:
"Prefix is used to namespace drips so that drip management can be handled modularly"
,
"prefix"
:
"operations"
,
"prefix"
:
"operations"
,
"__comment"
:
"Object attributes below are prefixed with numbers because of how foundry parses JSON into structs in alphabetical order"
,
"__comment"
:
"Object attributes below are prefixed with numbers because of how foundry parses JSON into structs in alphabetical order"
,
"drips"
:
[
"drips"
:
[
{
{
"00__name"
:
"sequencer_v
2
"
,
"00__name"
:
"sequencer_v
4
"
,
"01__dripcheck"
:
"CheckBalanceLow"
,
"01__dripcheck"
:
"CheckBalanceLow"
,
"02__checkparams"
:
{
"02__checkparams"
:
{
"01__target"
:
"0x8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c"
,
"01__target"
:
"0x8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c"
,
...
@@ -20,7 +40,7 @@
...
@@ -20,7 +40,7 @@
"06__data"
:
""
"06__data"
:
""
},
},
{
{
"00__name"
:
"proposer_v
2
"
,
"00__name"
:
"proposer_v
3
"
,
"01__dripcheck"
:
"CheckBalanceLow"
,
"01__dripcheck"
:
"CheckBalanceLow"
,
"02__checkparams"
:
{
"02__checkparams"
:
{
"01__target"
:
"0x49277EE36A024120Ee218127354c4a3591dc90A9"
,
"01__target"
:
"0x49277EE36A024120Ee218127354c4a3591dc90A9"
,
...
@@ -32,7 +52,19 @@
...
@@ -32,7 +52,19 @@
"06__data"
:
""
"06__data"
:
""
},
},
{
{
"00__name"
:
"gelato_v2"
,
"00__name"
:
"challenger_v2"
,
"01__dripcheck"
:
"CheckBalanceLow"
,
"02__checkparams"
:
{
"01__target"
:
"0xffb026F67DA0869EB3ABB090cB7F015CE0925CdF"
,
"02__threshold"
:
1000000000000000000000
},
"03__recipient"
:
"0x49277EE36A024120Ee218127354c4a3591dc90A9"
,
"04__value"
:
100000000000000000000
,
"05__interval"
:
3600
,
"06__data"
:
""
},
{
"00__name"
:
"gelato_v3"
,
"01__dripcheck"
:
"CheckGelatoLow"
,
"01__dripcheck"
:
"CheckGelatoLow"
,
"02__checkparams"
:
{
"02__checkparams"
:
{
"00__treasury"
:
"0x7506C12a824d73D9b08564d5Afc22c949434755e"
,
"00__treasury"
:
"0x7506C12a824d73D9b08564d5Afc22c949434755e"
,
...
@@ -43,19 +75,6 @@
...
@@ -43,19 +75,6 @@
"04__value"
:
1000000000000000000
,
"04__value"
:
1000000000000000000
,
"05__interval"
:
86400
,
"05__interval"
:
86400
,
"06__data"
:
"0x0000000000000000000000000Cd438409d5Cac9D2E076Ac7Bd0Bf2377E99BB6e4"
"06__data"
:
"0x0000000000000000000000000Cd438409d5Cac9D2E076Ac7Bd0Bf2377E99BB6e4"
},
{
"00__name"
:
"secrets_v2"
,
"01__dripcheck"
:
"CheckSecrets"
,
"02__checkparams"
:
{
"00__delay"
:
43200
,
"01__secretHashMustExist"
:
"0x565fa8c7daa859353b5b328b97b12c7d66c5832b2a24d4e0f739a65ad266a46f"
,
"02__secretHashMustNotExist"
:
"0xbc362b01d69a85dff1793803dde67df1f338f37a36fdc73dddf27283d215e614"
},
"03__recipient"
:
"0xCd438409d5Cac9D2E076Ac7Bd0Bf2377E99BB6e4"
,
"04__value"
:
1000000000000000000
,
"05__interval"
:
3600
,
"06__data"
:
""
}
}
]
]
}
}
packages/contracts-bedrock/safe.json
0 → 100644
View file @
42b8711b
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/scripts/periphery/drippie/DrippieConfig.s.sol
View file @
42b8711b
...
@@ -7,8 +7,6 @@ import { stdJson } from "forge-std/StdJson.sol";
...
@@ -7,8 +7,6 @@ import { stdJson } from "forge-std/StdJson.sol";
import { IAutomate as IGelato } from "gelato/interfaces/IAutomate.sol";
import { IAutomate as IGelato } from "gelato/interfaces/IAutomate.sol";
import { Artifacts } from "scripts/Artifacts.s.sol";
import { Drippie } from "src/periphery/drippie/Drippie.sol";
import { Drippie } from "src/periphery/drippie/Drippie.sol";
import { CheckBalanceLow } from "src/periphery/drippie/dripchecks/CheckBalanceLow.sol";
import { CheckBalanceLow } from "src/periphery/drippie/dripchecks/CheckBalanceLow.sol";
import { CheckGelatoLow } from "src/periphery/drippie/dripchecks/CheckGelatoLow.sol";
import { CheckGelatoLow } from "src/periphery/drippie/dripchecks/CheckGelatoLow.sol";
...
@@ -16,10 +14,16 @@ import { CheckSecrets } from "src/periphery/drippie/dripchecks/CheckSecrets.sol"
...
@@ -16,10 +14,16 @@ import { CheckSecrets } from "src/periphery/drippie/dripchecks/CheckSecrets.sol"
/// @title DrippieConfig
/// @title DrippieConfig
/// @notice Loads Drippie configuration from a JSON file.
/// @notice Loads Drippie configuration from a JSON file.
contract DrippieConfig is Script
, Artifacts
{
contract DrippieConfig is Script {
/// @notice Error emitted when an unknown drip check is encountered.
/// @notice Error emitted when an unknown drip check is encountered.
error UnknownDripCheck(string name);
error UnknownDripCheck(string name);
/// @notice Struct describing a dripcheck.
struct DripCheck {
string name;
address addr;
}
/// @notice Drip configuration with only name and dripcheck.
/// @notice Drip configuration with only name and dripcheck.
struct CoreDripConfig {
struct CoreDripConfig {
string name;
string name;
...
@@ -55,11 +59,11 @@ contract DrippieConfig is Script, Artifacts {
...
@@ -55,11 +59,11 @@ contract DrippieConfig is Script, Artifacts {
/// @notice Mapping of drip names in the config.
/// @notice Mapping of drip names in the config.
mapping(string => bool) public names;
mapping(string => bool) public names;
/// @notice Mapping of dripcheck names to addresses.
mapping(string => address) public dripchecks;
/// @param _path Path to the configuration file.
/// @param _path Path to the configuration file.
constructor(string memory _path) {
constructor(string memory _path) {
// Make sure artifacts are set up.
Artifacts.setUp();
// Load the configuration file.
// Load the configuration file.
console.log("DrippieConfig: reading file %s", _path);
console.log("DrippieConfig: reading file %s", _path);
try vm.readFile(_path) returns (string memory data) {
try vm.readFile(_path) returns (string memory data) {
...
@@ -88,6 +92,12 @@ contract DrippieConfig is Script, Artifacts {
...
@@ -88,6 +92,12 @@ contract DrippieConfig is Script, Artifacts {
CoreDripConfig[] memory corecfg = abi.decode(stdJson.parseRaw(_json, "$.drips"), (CoreDripConfig[]));
CoreDripConfig[] memory corecfg = abi.decode(stdJson.parseRaw(_json, "$.drips"), (CoreDripConfig[]));
console.log("DrippieConfig: found %d drips", corecfg.length);
console.log("DrippieConfig: found %d drips", corecfg.length);
// Load the dripchecks.
DripCheck[] memory checks = abi.decode(stdJson.parseRaw(_json, "$.dripchecks"), (DripCheck[]));
for (uint256 i = 0; i < checks.length; i++) {
dripchecks[checks[i].name] = checks[i].addr;
}
// Iterate and parse all of the drips.
// Iterate and parse all of the drips.
for (uint256 i = 0; i < corecfg.length; i++) {
for (uint256 i = 0; i < corecfg.length; i++) {
// Log so we know what's being loaded.
// Log so we know what's being loaded.
...
@@ -98,7 +108,7 @@ contract DrippieConfig is Script, Artifacts {
...
@@ -98,7 +108,7 @@ contract DrippieConfig is Script, Artifacts {
// Make sure the dripcheck is deployed.
// Make sure the dripcheck is deployed.
string memory dripcheck = corecfg[i].dripcheck;
string memory dripcheck = corecfg[i].dripcheck;
console.log("DrippieConfig: attempting to get address for %s", dripcheck);
console.log("DrippieConfig: attempting to get address for %s", dripcheck);
mustGet
Address
(dripcheck);
mustGet
DripCheck
(dripcheck);
// Generate the base JSON path string.
// Generate the base JSON path string.
string memory p = string.concat("$.drips[", vm.toString(i), "]");
string memory p = string.concat("$.drips[", vm.toString(i), "]");
...
@@ -149,6 +159,14 @@ contract DrippieConfig is Script, Artifacts {
...
@@ -149,6 +159,14 @@ contract DrippieConfig is Script, Artifacts {
return abi.encode(drips[_index]);
return abi.encode(drips[_index]);
}
}
/// @notice Retrieves the address of a dripcheck and reverts if it is not found.
/// @param _name Name of the dripcheck.
/// @return addr_ Address of the dripcheck.
function mustGetDripCheck(string memory _name) public view returns (address addr_) {
addr_ = dripchecks[_name];
require(addr_ != address(0), "DrippieConfig: unknown dripcheck");
}
/// @notice Check if two strings are equal.
/// @notice Check if two strings are equal.
/// @param _a First string.
/// @param _a First string.
/// @param _b Second string.
/// @param _b Second string.
...
...
packages/contracts-bedrock/scripts/periphery/drippie/ManageDrippie.s.sol
View file @
42b8711b
...
@@ -12,7 +12,6 @@ import { LibTaskId as GelatoTaskId } from "gelato/libraries/LibTaskId.sol";
...
@@ -12,7 +12,6 @@ import { LibTaskId as GelatoTaskId } from "gelato/libraries/LibTaskId.sol";
import { GelatoBytes } from "gelato/vendor/gelato/GelatoBytes.sol";
import { GelatoBytes } from "gelato/vendor/gelato/GelatoBytes.sol";
import { Config } from "scripts/libraries/Config.sol";
import { Config } from "scripts/libraries/Config.sol";
import { Artifacts } from "scripts/Artifacts.s.sol";
import { DrippieConfig } from "scripts/periphery/drippie/DrippieConfig.s.sol";
import { DrippieConfig } from "scripts/periphery/drippie/DrippieConfig.s.sol";
import { Drippie } from "src/periphery/drippie/Drippie.sol";
import { Drippie } from "src/periphery/drippie/Drippie.sol";
...
@@ -20,7 +19,7 @@ import { IDripCheck } from "src/periphery/drippie/IDripCheck.sol";
...
@@ -20,7 +19,7 @@ import { IDripCheck } from "src/periphery/drippie/IDripCheck.sol";
/// @title ManageDrippie
/// @title ManageDrippie
/// @notice Script for managing drips in the Drippie contract.
/// @notice Script for managing drips in the Drippie contract.
contract ManageDrippie is Script
, Artifacts
{
contract ManageDrippie is Script {
/// @notice Struct that contains the data for a Gelato task.
/// @notice Struct that contains the data for a Gelato task.
struct GelatoTaskData {
struct GelatoTaskData {
address taskCreator;
address taskCreator;
...
@@ -41,8 +40,7 @@ contract ManageDrippie is Script, Artifacts {
...
@@ -41,8 +40,7 @@ contract ManageDrippie is Script, Artifacts {
}
}
/// @notice Sets up the deployment script.
/// @notice Sets up the deployment script.
function setUp() public override {
function setUp() public {
Artifacts.setUp();
cfg = new DrippieConfig(Config.deployConfigPath());
cfg = new DrippieConfig(Config.deployConfigPath());
console.log("Config path: %s", Config.deployConfigPath());
console.log("Config path: %s", Config.deployConfigPath());
}
}
...
@@ -94,7 +92,7 @@ contract ManageDrippie is Script, Artifacts {
...
@@ -94,7 +92,7 @@ contract ManageDrippie is Script, Artifacts {
_config: Drippie.DripConfig({
_config: Drippie.DripConfig({
reentrant: false,
reentrant: false,
interval: drip.interval,
interval: drip.interval,
dripcheck: IDripCheck(
mustGetAddress
(drip.dripcheck)),
dripcheck: IDripCheck(
cfg.mustGetDripCheck
(drip.dripcheck)),
checkparams: drip.checkparams,
checkparams: drip.checkparams,
actions: actions
actions: actions
})
})
...
...
packages/contracts-bedrock/scripts/safe/forge-to-safe-json.ts
0 → 100644
View file @
42b8711b
import
fs
from
'
fs
'
import
crypto
from
'
crypto
'
interface
ForgeTransaction
{
contractAddress
:
string
transaction
:
{
to
:
string
value
:
string
input
:
string
}
}
interface
ForgeTransactionFile
{
transactions
:
ForgeTransaction
[]
timestamp
:
number
chain
:
number
}
interface
SafeTransaction
{
to
:
string
value
:
string
data
:
string
contractMethod
:
null
contractInputsValues
:
null
}
interface
SafeTransactionFile
{
version
:
string
chainId
:
string
createdAt
:
number
meta
:
{
name
:
string
description
:
string
txBuilderVersion
:
string
createdFromSafeAddress
:
string
createdFromOwnerAddress
:
string
checksum
:
string
}
transactions
:
SafeTransaction
[]
}
/**
* Calculate the checksum for a safe transaction file.
* @param data The safe transaction file.
* @returns The checksum.
*/
const
checksum
=
(
data
:
SafeTransactionFile
):
string
=>
{
const
hash
=
crypto
.
createHash
(
'
sha256
'
)
hash
.
update
(
JSON
.
stringify
(
data
.
transactions
))
return
`0x
${
hash
.
digest
(
'
hex
'
)}
`
}
/**
* Transform a forge transaction file into a safe transaction file.
* @param forge Forge transaction file.
* @param address Safe address.
* @returns Safe transaction file.
*/
const
transform
=
(
forge
:
ForgeTransactionFile
,
address
:
string
):
SafeTransactionFile
=>
{
const
transactions
=
forge
.
transactions
.
map
((
tx
)
=>
({
to
:
tx
.
contractAddress
,
value
:
'
0
'
,
data
:
tx
.
transaction
.
input
,
contractMethod
:
null
,
contractInputsValues
:
null
,
}))
const
safe
:
SafeTransactionFile
=
{
version
:
'
1.0
'
,
chainId
:
forge
.
chain
.
toString
(),
createdAt
:
forge
.
timestamp
,
meta
:
{
name
:
'
Transactions Batch
'
,
description
:
''
,
txBuilderVersion
:
'
1.16.5
'
,
createdFromSafeAddress
:
address
,
createdFromOwnerAddress
:
''
,
checksum
:
''
,
},
transactions
,
}
safe
.
meta
.
checksum
=
checksum
(
safe
)
return
safe
}
/**
* Get a required argument from the command line.
* @param name The argument name.
* @returns The argument value.
*/
const
reqarg
=
(
name
:
string
)
=>
{
const
value
=
process
.
argv
.
find
((
arg
)
=>
arg
.
startsWith
(
`--
${
name
}
=`
))
if
(
!
value
)
{
console
.
error
(
`Please provide --
${
name
}
argument`
)
process
.
exit
(
1
)
}
return
value
.
split
(
'
=
'
)[
1
]
}
/**
* Main function.
*/
const
main
=
()
=>
{
const
input
=
reqarg
(
'
input
'
)
const
output
=
reqarg
(
'
output
'
)
const
address
=
reqarg
(
'
safe
'
)
// Load the original forge transaction file.
const
forge
:
ForgeTransactionFile
=
JSON
.
parse
(
fs
.
readFileSync
(
input
,
'
utf8
'
))
// Transform the forge transaction file into a safe transaction file.
const
safe
=
transform
(
forge
,
address
)
// Write the safe transaction file.
fs
.
writeFileSync
(
output
,
JSON
.
stringify
(
safe
,
null
,
2
),
'
utf8
'
)
}
// Run the main function.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment