Source Code
Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer Ownersh... | 21374602 | 460 days ago | IN | 0 ETH | 0.00058032 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MockUsdsJoin
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
pragma solidity ^0.8.21;
import { IERC20 } from "forge-std/interfaces/IERC20.sol";
import { Ownable } from "openzeppelin-contracts/contracts/access/Ownable.sol";
contract MockUsdsJoin is Ownable {
address public immutable vat;
IERC20 public immutable usds;
constructor(address owner_, address vat_, address usds_) Ownable(owner_) {
vat = vat_;
usds = IERC20(usds_);
}
function join(address, uint256 wad) external onlyOwner {
usds.transferFrom(msg.sender, address(this), wad);
}
function exit(address usr, uint256 wad) external onlyOwner {
usds.transfer(usr, wad);
}
// To fully cover daiJoin abi
function dai() external view returns (address) {
return address(usds);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;
/// @dev Interface of the ERC20 standard as defined in the EIP.
/// @dev This includes the optional name, symbol, and decimals metadata.
interface IERC20 {
/// @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`).
event Transfer(address indexed from, address indexed to, uint256 value);
/// @dev Emitted when the allowance of a `spender` for an `owner` is set, where `value`
/// is the new allowance.
event Approval(address indexed owner, address indexed spender, uint256 value);
/// @notice Returns the amount of tokens in existence.
function totalSupply() external view returns (uint256);
/// @notice Returns the amount of tokens owned by `account`.
function balanceOf(address account) external view returns (uint256);
/// @notice Moves `amount` tokens from the caller's account to `to`.
function transfer(address to, uint256 amount) external returns (bool);
/// @notice Returns the remaining number of tokens that `spender` is allowed
/// to spend on behalf of `owner`
function allowance(address owner, address spender) external view returns (uint256);
/// @notice Sets `amount` as the allowance of `spender` over the caller's tokens.
/// @dev Be aware of front-running risks: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
function approve(address spender, uint256 amount) external returns (bool);
/// @notice Moves `amount` tokens from `from` to `to` using the allowance mechanism.
/// `amount` is then deducted from the caller's allowance.
function transferFrom(address from, address to, uint256 amount) external returns (bool);
/// @notice Returns the name of the token.
function name() external view returns (string memory);
/// @notice Returns the symbol of the token.
function symbol() external view returns (string memory);
/// @notice Returns the decimals places of the token.
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}{
"remappings": [
"dss-allocator/=lib/dss-allocator/",
"dss-test/=lib/dss-test/src/",
"usds/=lib/usds/",
"sdai/=lib/sdai/",
"spark-psm/=lib/spark-psm/",
"spark-address-registry/=lib/spark-address-registry/",
"xchain-helpers/=lib/xchain-helpers/",
"@openzeppelin/contracts-upgradeable/=lib/sdai/lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"aave-v3-core/=lib/aave-v3-origin/src/core/",
"aave-v3-origin/=lib/aave-v3-origin/",
"aave-v3-periphery/=lib/aave-v3-origin/src/periphery/",
"ds-test/=lib/metamorpho/lib/forge-std/lib/ds-test/src/",
"dss-interfaces/=lib/dss-test/lib/dss-interfaces/src/",
"erc20-helpers/=lib/erc20-helpers/src/",
"erc4626-tests/=lib/metamorpho/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"metamorpho/=lib/metamorpho/src/",
"morpho-blue/=lib/metamorpho/lib/morpho-blue/",
"murky/=lib/metamorpho/lib/universal-rewards-distributor/lib/murky/src/",
"openzeppelin-contracts-upgradeable/=lib/sdai/lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/sdai/lib/openzeppelin-foundry-upgrades/src/",
"openzeppelin/=lib/metamorpho/lib/universal-rewards-distributor/lib/openzeppelin-contracts/contracts/",
"solidity-stringutils/=lib/sdai/lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
"solidity-utils/=lib/aave-v3-origin/lib/solidity-utils/",
"sparklend-address-registry/=lib/spark-psm/lib/xchain-ssr-oracle/lib/sparklend-address-registry/",
"token-tests/=lib/sdai/lib/token-tests/src/",
"universal-rewards-distributor/=lib/metamorpho/lib/universal-rewards-distributor/src/",
"xchain-ssr-oracle/=lib/spark-psm/lib/xchain-ssr-oracle/"
],
"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":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"vat_","type":"address"},{"internalType":"address","name":"usds_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"dai","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"join","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usds","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vat","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c060405234801561000f575f80fd5b5060405161054f38038061054f83398101604081905261002e916100e8565b826001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100658161007e565b506001600160a01b039182166080521660a05250610128565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100e3575f80fd5b919050565b5f805f606084860312156100fa575f80fd5b610103846100cd565b9250610111602085016100cd565b915061011f604085016100cd565b90509250925092565b60805160a0516103f361015c5f395f818160e60152818161014801528181610196015261024f01525f608e01526103f35ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638da5cb5b116100585780638da5cb5b14610110578063ef693bed14610120578063f2fde38b14610133578063f4b9fa7514610146575f80fd5b806336569e77146100895780633b4da69f146100cc5780634cf282fb146100e1578063715018a614610108575b5f80fd5b6100b07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100df6100da366004610356565b61016c565b005b6100b07f000000000000000000000000000000000000000000000000000000000000000081565b6100df61020e565b5f546001600160a01b03166100b0565b6100df61012e366004610356565b610221565b6100df61014136600461037e565b61027e565b7f00000000000000000000000000000000000000000000000000000000000000006100b0565b6101746102c0565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064015b6020604051808303815f875af11580156101e5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610209919061039e565b505050565b6102166102c0565b61021f5f6102ec565b565b6102296102c0565b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016101c9565b6102866102c0565b6001600160a01b0381166102b457604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6102bd816102ec565b50565b5f546001600160a01b0316331461021f5760405163118cdaa760e01b81523360048201526024016102ab565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610351575f80fd5b919050565b5f8060408385031215610367575f80fd5b6103708361033b565b946020939093013593505050565b5f6020828403121561038e575f80fd5b6103978261033b565b9392505050565b5f602082840312156103ae575f80fd5b81518015158114610397575f80fdfea26469706673582212204d245ff780a75d30997276b8711f286ec6d0d98a9f0fd4941fb07f2957b1cb7b64736f6c63430008150033000000000000000000000000d1236a6a111879d9862f8374ba15344b6b233fbd000000000000000000000000ccba298e63411df1156c6432ec332a1ab04b41d7000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638da5cb5b116100585780638da5cb5b14610110578063ef693bed14610120578063f2fde38b14610133578063f4b9fa7514610146575f80fd5b806336569e77146100895780633b4da69f146100cc5780634cf282fb146100e1578063715018a614610108575b5f80fd5b6100b07f000000000000000000000000ccba298e63411df1156c6432ec332a1ab04b41d781565b6040516001600160a01b03909116815260200160405180910390f35b6100df6100da366004610356565b61016c565b005b6100b07f000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f81565b6100df61020e565b5f546001600160a01b03166100b0565b6100df61012e366004610356565b610221565b6100df61014136600461037e565b61027e565b7f000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f6100b0565b6101746102c0565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f6001600160a01b0316906323b872dd906064015b6020604051808303815f875af11580156101e5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610209919061039e565b505050565b6102166102c0565b61021f5f6102ec565b565b6102296102c0565b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f169063a9059cbb906044016101c9565b6102866102c0565b6001600160a01b0381166102b457604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6102bd816102ec565b50565b5f546001600160a01b0316331461021f5760405163118cdaa760e01b81523360048201526024016102ab565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610351575f80fd5b919050565b5f8060408385031215610367575f80fd5b6103708361033b565b946020939093013593505050565b5f6020828403121561038e575f80fd5b6103978261033b565b9392505050565b5f602082840312156103ae575f80fd5b81518015158114610397575f80fdfea26469706673582212204d245ff780a75d30997276b8711f286ec6d0d98a9f0fd4941fb07f2957b1cb7b64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d1236a6a111879d9862f8374ba15344b6b233fbd000000000000000000000000ccba298e63411df1156c6432ec332a1ab04b41d7000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f
-----Decoded View---------------
Arg [0] : owner_ (address): 0xd1236a6A111879d9862f8374BA15344b6B233Fbd
Arg [1] : vat_ (address): 0xcCBA298E63411df1156c6432Ec332a1aB04B41d7
Arg [2] : usds_ (address): 0xdC035D45d973E3EC169d2276DDab16f1e407384F
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d1236a6a111879d9862f8374ba15344b6b233fbd
Arg [1] : 000000000000000000000000ccba298e63411df1156c6432ec332a1ab04b41d7
Arg [2] : 000000000000000000000000dc035d45d973e3ec169d2276ddab16f1e407384f
Loading...
Loading
Loading...
Loading
Net Worth in USD
$10.00
Net Worth in ETH
0.004272
Token Allocations
USDS
100.00%
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $0.999919 | 10 | $10 |
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.