Verified contractExactAGPL-3.0-or-later
AllocatorBuffer
Address0x51e9681d7a05abfd33efafd43e5dd3afc0093f1d
- Balance
0 ETH
- Transactions
3
- Compiler
solc 0.8.16
- Same code
5 more contracts
Details
- Compiler
- solc 0.8.16+commit.07a7930e
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- london
- License
- AGPL-3.0-or-later
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 23,534,309
- Creation transaction
- 0x24dd6fd4e2…99a2e03283
- Main copy (most transactions)
- 0x629ad4d7…04d8b1cd
src/AllocatorBuffer.sol
// SPDX-FileCopyrightText: © 2023 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// 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 <http://www.gnu.org/licenses/>.
pragma solidity ^0.8.16;
interface GemLike {
function approve(address, uint256) external;
}
contract AllocatorBuffer {
// --- storage variables ---
mapping(address => uint256) public wards;
// --- events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event Approve(address indexed asset, address indexed spender, uint256 amount);
// --- modifiers ---
modifier auth() {
require(wards[msg.sender] == 1, "AllocatorBuffer/not-authorized");
_;
}
// --- constructor ---
constructor() {
wards[msg.sender] = 1;
emit Rely(msg.sender);
}
// --- administration ---
function rely(address usr) external auth {
wards[usr] = 1;
emit Rely(usr);
}
function deny(address usr) external auth {
wards[usr] = 0;
emit Deny(usr);
}
// --- functions ---
function approve(address asset, address spender, uint256 amount) external auth {
GemLike(asset).approve(spender, amount);
emit Approve(asset, spender, amount);
}
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "london",
"remappings": [
":ds-test/=lib/dss-test/lib/forge-std/lib/ds-test/src/",
":dss-interfaces/=lib/dss-test/lib/dss-interfaces/src/",
":dss-test/=lib/dss-test/src/",
":forge-std/=lib/dss-test/lib/forge-std/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.