Verified contractPartial
SetPotDSR
Address0xcd2f138a8ab432a3fb9cc5f01668a1f0459dbb7d
- Balance
0 ETH
- Transactions
3
- Compiler
solc 0.5.17
- Same code
Only this contract
Details
- Compiler
- solc 0.5.17+commit.d19bba13
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 16,547,822
- Creation transaction
- 0xe52c884e1f…2a392556f7
SetPotDSR.sol
// Copyright (C) 2021 Hot Ecosystem Growth Holdings, INC.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity ^0.5.15;
//import "lib/dss-interfaces/src/dss/PotAbstract.sol";
//import "lib/dss-interfaces/src/dapp/DSPauseAbstract.sol";
interface PotAbstract {
function wards(address) external view returns (uint256);
function rely(address) external;
function deny(address) external;
function pie(address) external view returns (uint256);
function Pie() external view returns (uint256);
function dsr() external view returns (uint256);
function chi() external view returns (uint256);
function vat() external view returns (address);
function vow() external view returns (address);
function rho() external view returns (uint256);
function live() external view returns (uint256);
function file(bytes32, uint256) external;
function file(bytes32, address) external;
function cage() external;
function drip() external returns (uint256);
function join(uint256) external;
function exit(uint256) external;
}
interface DSPauseAbstract {
function owner() external view returns (address);
function authority() external view returns (address);
function setOwner(address) external;
function setAuthority(address) external;
function setDelay(uint256) external;
function plans(bytes32) external view returns (bool);
function proxy() external view returns (address);
function delay() external view returns (uint256);
function plot(address, bytes32, bytes calldata, uint256) external;
function drop(address, bytes32, bytes calldata, uint256) external;
function exec(address, bytes32, bytes calldata, uint256) external returns (bytes memory);
}
contract SpellAction {
address constant MCD_POT = 0x37E453760B3BE9b200a39f1251E82cF0dDF3999B;
function execute() external {
// e.g. 2.5
// echo $(bc -l <<< "scale=27; e( l(2.5 / 100 + 1)/(60 * 60 * 24 * 365)) * 10^27")
//1000000000782997609082909351 2.5
//1000000000937303470807876289 3.0
PotAbstract(MCD_POT).drip();
PotAbstract(MCD_POT).file("dsr", 1000000000937303470807876289);
}
function stringToBytes32(string memory source) public pure returns (bytes32 result) {
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
}
contract SetPotDSR {
DSPauseAbstract public pause = DSPauseAbstract(0x385ad10A37b1a8014b7511cAAF3A2358f2A450e8);
address public action;
bytes32 public tag;
uint256 public eta;
bytes public sig;
uint256 public expiration;
bool public done;
string constant public description = "Spell Deploy";
constructor() public {
sig = abi.encodeWithSignature("execute()");
action = address(new SpellAction());
bytes32 _tag;
address _action = action;
assembly { _tag := extcodehash(_action) }
tag = _tag;
expiration = now + 30 days;
}
function schedule() public {
require(now <= expiration, "This contract has expired");
require(eta == 0, "This spell has already been scheduled");
eta = now + DSPauseAbstract(pause).delay();
pause.plot(action, tag, sig, eta);
}
function cast() public {
require(!done, "spell-already-cast");
done = true;
pause.exec(action, tag, sig, eta);
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.