Skip to content

Commit

Permalink
Switch RepoDriver to Gelato
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeSandwich committed Jul 20, 2024
1 parent d23652b commit 357da78
Show file tree
Hide file tree
Showing 7 changed files with 610 additions and 616 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/chainlink"]
path = lib/chainlink
url = https://github.com/smartcontractkit/chainlink
[submodule "lib/LayerZero-v2"]
path = lib/LayerZero-v2
url = https://github.com/LayerZero-Labs/LayerZero-v2
[submodule "lib/gelato-automate"]
path = lib/gelato-automate
url = https://github.com/gelatodigital/automate
1 change: 0 additions & 1 deletion lib/chainlink
Submodule chainlink deleted from 594387
1 change: 1 addition & 0 deletions lib/gelato-automate
Submodule gelato-automate added at ae1cac
2 changes: 1 addition & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/
chainlink/=lib/chainlink/contracts/src/v0.8/
layer-zero-v2/=lib/LayerZero-v2/
gelato-automate/=lib/gelato-automate/contracts/
28 changes: 10 additions & 18 deletions src/DripsDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Drips} from "./Drips.sol";
import {ImmutableSplitsDriver} from "./ImmutableSplitsDriver.sol";
import {Managed, ManagedProxy} from "./Managed.sol";
import {NFTDriver} from "./NFTDriver.sol";
import {OperatorInterface, RepoDriver} from "./RepoDriver.sol";
import {RepoDriver} from "./RepoDriver.sol";
import {Ownable2Step} from "openzeppelin-contracts/access/Ownable2Step.sol";
import {Address} from "openzeppelin-contracts/utils/Address.sol";

Expand Down Expand Up @@ -293,35 +293,27 @@ contract ImmutableSplitsDriverModule is DriverModule(2) {
}

contract RepoDriverModule is CallerDependentModule, DriverModule(3) {
OperatorInterface public immutable operator;
bytes32 public immutable jobId;
uint96 public immutable defaultFee;
string public ipfsCid;

function args() public view override returns (bytes memory) {
return abi.encode(dripsDeployer, proxyAdmin, operator, jobId, defaultFee);
return abi.encode(dripsDeployer, proxyAdmin, ipfsCid);
}

constructor(
DripsDeployer dripsDeployer_,
address proxyAdmin_,
OperatorInterface operator_,
bytes32 jobId_,
uint96 defaultFee_
) BaseModule(dripsDeployer_, "RepoDriver") {
operator = operator_;
jobId = jobId_;
defaultFee = defaultFee_;
constructor(DripsDeployer dripsDeployer_, address proxyAdmin_, string memory ipfsCid_)
BaseModule(dripsDeployer_, "RepoDriver")
{
ipfsCid = ipfsCid_;
bytes memory data = abi.encodeCall(RepoDriver.updateGelatoTask, (ipfsCid_));
// slither-disable-next-line too-many-digits
_deployProxy(proxyAdmin_, type(RepoDriver).creationCode);
repoDriver().initializeAnyApiOperator(operator, jobId, defaultFee);
_deployProxy(proxyAdmin_, type(RepoDriver).creationCode, data);
}

function logicArgs() public view override returns (bytes memory) {
return abi.encode(_dripsModule().drips(), _callerModule().caller(), driverId);
}

function repoDriver() public view returns (RepoDriver) {
return RepoDriver(proxy());
return RepoDriver(payable(proxy()));
}
}

Expand Down
Loading

0 comments on commit 357da78

Please sign in to comment.