• smartcontracts's avatar
    feat(ctp): introduce Drippie and rework deploy (#2569) · 416d2e60
    smartcontracts authored
    Drippie is a helper contract for managing automatic contract
    interactions. Drippie is meant to be deployed as a middle layer between
    our contracts and other automation services like Gelato. This commit
    also revamps the deployment process to use hardhat-deploy deterministic
    deployments, ledger support, and better authentication.
    416d2e60
CallRecorder.sol 418 Bytes
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

contract CallRecorder {
    struct CallInfo {
        address sender;
        bytes data;
        uint256 gas;
        uint256 value;
    }

    CallInfo public lastCall;

    function record() public payable {
        lastCall.sender = msg.sender;
        lastCall.data = msg.data;
        lastCall.gas = gasleft();
        lastCall.value = msg.value;
    }
}