Source Code
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Escrow
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2024 Dai Foundation
// 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.8.21;
interface GemLike {
function approve(address, uint256) external;
}
// Escrow funds on L1, manage approval rights
contract Escrow {
// --- storage variables ---
mapping(address => uint256) public wards;
// --- events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event Approve(address indexed token, address indexed spender, uint256 value);
// --- modifiers ---
modifier auth() {
require(wards[msg.sender] == 1, "Escrow/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);
}
// --- approve ---
function approve(address token, address spender, uint256 value) external auth {
GemLike(token).approve(spender, value);
emit Approve(token, spender, value);
}
}{
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"forge-std/=lib/dss-test/lib/forge-std/src/",
"ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"dss-interfaces/=lib/dss-test/lib/dss-interfaces/src/",
"dss-test/=lib/dss-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "shanghai",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approve","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usr","type":"address"}],"name":"Deny","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usr","type":"address"}],"name":"Rely","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"deny","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"rely","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561000f575f80fd5b50335f8181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a261035c806100555f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c806365fae35e1461004e5780639c52a7f114610063578063bf353dbb14610076578063e1f21c67146100a7575b5f80fd5b61006161005c36600461029e565b6100ba565b005b61006161007136600461029e565b610135565b61009561008436600461029e565b5f6020819052908152604090205481565b60405190815260200160405180910390f35b6100616100b53660046102be565b6101a6565b335f908152602081905260409020546001146100f15760405162461bcd60e51b81526004016100e8906102f7565b60405180910390fd5b6001600160a01b0381165f8181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b335f908152602081905260409020546001146101635760405162461bcd60e51b81526004016100e8906102f7565b6001600160a01b0381165f81815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b335f908152602081905260409020546001146101d45760405162461bcd60e51b81526004016100e8906102f7565b60405163095ea7b360e01b81526001600160a01b0383811660048301526024820183905284169063095ea7b3906044015f604051808303815f87803b15801561021b575f80fd5b505af115801561022d573d5f803e3d5ffd5b50505050816001600160a01b0316836001600160a01b03167f6e11fb1b7f119e3f2fa29896ef5fdf8b8a2d0d4df6fe90ba8668e7d8b2ffa25e8360405161027691815260200190565b60405180910390a3505050565b80356001600160a01b0381168114610299575f80fd5b919050565b5f602082840312156102ae575f80fd5b6102b782610283565b9392505050565b5f805f606084860312156102d0575f80fd5b6102d984610283565b92506102e760208501610283565b9150604084013590509250925092565b602080825260159082015274115cd8dc9bddcbdb9bdd0b585d5d1a1bdc9a5e9959605a1b60408201526060019056fea264697066735822122080d8b209f020198beff64a598ea7db8afcf74318c5b8c2c5d23e9cb6940fcf3e64736f6c63430008150033
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c806365fae35e1461004e5780639c52a7f114610063578063bf353dbb14610076578063e1f21c67146100a7575b5f80fd5b61006161005c36600461029e565b6100ba565b005b61006161007136600461029e565b610135565b61009561008436600461029e565b5f6020819052908152604090205481565b60405190815260200160405180910390f35b6100616100b53660046102be565b6101a6565b335f908152602081905260409020546001146100f15760405162461bcd60e51b81526004016100e8906102f7565b60405180910390fd5b6001600160a01b0381165f8181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b335f908152602081905260409020546001146101635760405162461bcd60e51b81526004016100e8906102f7565b6001600160a01b0381165f81815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b335f908152602081905260409020546001146101d45760405162461bcd60e51b81526004016100e8906102f7565b60405163095ea7b360e01b81526001600160a01b0383811660048301526024820183905284169063095ea7b3906044015f604051808303815f87803b15801561021b575f80fd5b505af115801561022d573d5f803e3d5ffd5b50505050816001600160a01b0316836001600160a01b03167f6e11fb1b7f119e3f2fa29896ef5fdf8b8a2d0d4df6fe90ba8668e7d8b2ffa25e8360405161027691815260200190565b60405180910390a3505050565b80356001600160a01b0381168114610299575f80fd5b919050565b5f602082840312156102ae575f80fd5b6102b782610283565b9392505050565b5f805f606084860312156102d0575f80fd5b6102d984610283565b92506102e760208501610283565b9150604084013590509250925092565b602080825260159082015274115cd8dc9bddcbdb9bdd0b585d5d1a1bdc9a5e9959605a1b60408201526060019056fea264697066735822122080d8b209f020198beff64a598ea7db8afcf74318c5b8c2c5d23e9cb6940fcf3e64736f6c63430008150033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$202,300,172.67
Net Worth in ETH
98,561.206105
Token Allocations
SUSDS
50.57%
USDS
49.43%
Multichain Portfolio | 33 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.