Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x65419591...62dd98daB The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
TransferHook
Compiler Version
v0.8.30+commit.73712a01
Optimization Enabled:
Yes with 200 runs
Other Settings:
prague EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import {IWithdrawable} from "./IHook.sol";
import {AbstractHook} from "./AbstractHook.sol";
contract TransferHook is AbstractHook {
error TransferFailed();
error InsufficientAllocation();
constructor() {}
function execute(address, address _recipient, bytes32, uint256 _allocatedamount, bytes memory _extra)
external
returns (uint256 _consumed)
{
uint256 _amount = abi.decode(_extra, (uint256));
bool _isWrappedToken = _distributor().isWrappedToken();
if (_amount > _allocatedamount) revert InsufficientAllocation();
if (_isWrappedToken) {
address _token = _distributor().token();
_distributor().hookTransfer(address(this), _amount);
IWithdrawable(_token).withdraw(_amount);
(bool success,) = payable(_recipient).call{value: _amount}("");
if (!success) revert TransferFailed();
} else {
_distributor().hookTransfer(_recipient, _amount);
}
return _amount;
}
receive() external payable {}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
interface IWithdrawable {
function withdraw(uint256 _wad) external;
}
interface IHook {
function execute(address _vault, address _recipient, bytes32 _root, uint256 _allocatedamount, bytes memory _extra)
external
returns (uint256 _consumed);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
import {IHook} from "./IHook.sol";
import {IDistributor} from "../sub/IDistributor.sol";
abstract contract AbstractHook is IHook {
function _distributor() internal view returns (IDistributor) {
return IDistributor(msg.sender);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;
interface IDistributor {
function hookTransfer(address _recipient, uint256 _amount) external;
function token() external view returns (address);
function isWrappedToken() external view returns (bool);
function configurationId(bytes32 _root) external view returns (bytes32);
}{
"remappings": [
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"solady/=lib/solady/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": false
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "prague",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InsufficientAllocation","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"_allocatedamount","type":"uint256"},{"internalType":"bytes","name":"_extra","type":"bytes"}],"name":"execute","outputs":[{"internalType":"uint256","name":"_consumed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
0x6080806040523460155761039d908161001a8239f35b5f80fdfe6080604052600436101561001a575b3615610018575f80fd5b005b5f5f3560e01c6344c9160314610030575061000e565b346102e75760a03660031901126102e757610049610335565b50602435906001600160a01b0382168083036102e75760843567ffffffffffffffff81116102e757366023820112156102e75780600401359061008b82610381565b610098604051918261034b565b828152602081019236602482850101116102e7576020815f9260248396018737830101528051810103126102e7575192604051630f05d09360e11b8152602081600481335afa9081156102dc575f916102fa575b5060643585116102eb571561027e5750604051637e062a3560e11b8152602081600481335afa90811561020d57839161023c575b50333b156102185760405163d56881c960e01b815230600482015260248101859052838160448183335af180156102315790849161021c575b50506001600160a01b0316803b1561021857828091602460405180948193632e1a7d4d60e01b83528960048401525af1801561020d5791839185936101ef575b5081809381925af13d156101ea573d6101b181610381565b906101bf604051928361034b565b81528260203d92013e5b156101db57506020905b604051908152f35b6312171d8360e31b8152600490fd5b6101c9565b6101fc919350829061034b565b610209578183915f610199565b5080fd5b6040513d85823e3d90fd5b8280fd5b816102269161034b565b61021857825f610159565b6040513d86823e3d90fd5b90506020813d602011610276575b816102576020938361034b565b8101031261021857516001600160a01b0381168103610218575f610120565b3d915061024a565b92915050333b156102e75760405163d56881c960e01b81526001600160a01b03929092166004830152602482018190525f8260448183335af19182156102dc576020926102cc575b506101d3565b5f6102d69161034b565b5f6102c6565b6040513d5f823e3d90fd5b5f80fd5b6337cb51dd60e21b5f5260045ffd5b90506020813d60201161032d575b816103156020938361034b565b810103126102e7575180151581036102e7575f6100ec565b3d9150610308565b600435906001600160a01b03821682036102e757565b90601f8019910116810190811067ffffffffffffffff82111761036d57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161036d57601f01601f19166020019056
Deployed Bytecode
0x6080604052600436101561001a575b3615610018575f80fd5b005b5f5f3560e01c6344c9160314610030575061000e565b346102e75760a03660031901126102e757610049610335565b50602435906001600160a01b0382168083036102e75760843567ffffffffffffffff81116102e757366023820112156102e75780600401359061008b82610381565b610098604051918261034b565b828152602081019236602482850101116102e7576020815f9260248396018737830101528051810103126102e7575192604051630f05d09360e11b8152602081600481335afa9081156102dc575f916102fa575b5060643585116102eb571561027e5750604051637e062a3560e11b8152602081600481335afa90811561020d57839161023c575b50333b156102185760405163d56881c960e01b815230600482015260248101859052838160448183335af180156102315790849161021c575b50506001600160a01b0316803b1561021857828091602460405180948193632e1a7d4d60e01b83528960048401525af1801561020d5791839185936101ef575b5081809381925af13d156101ea573d6101b181610381565b906101bf604051928361034b565b81528260203d92013e5b156101db57506020905b604051908152f35b6312171d8360e31b8152600490fd5b6101c9565b6101fc919350829061034b565b610209578183915f610199565b5080fd5b6040513d85823e3d90fd5b8280fd5b816102269161034b565b61021857825f610159565b6040513d86823e3d90fd5b90506020813d602011610276575b816102576020938361034b565b8101031261021857516001600160a01b0381168103610218575f610120565b3d915061024a565b92915050333b156102e75760405163d56881c960e01b81526001600160a01b03929092166004830152602482018190525f8260448183335af19182156102dc576020926102cc575b506101d3565b5f6102d69161034b565b5f6102c6565b6040513d5f823e3d90fd5b5f80fd5b6337cb51dd60e21b5f5260045ffd5b90506020813d60201161032d575b816103156020938361034b565b810103126102e7575180151581036102e7575f6100ec565b3d9150610308565b600435906001600160a01b03821682036102e757565b90601f8019910116810190811067ffffffffffffffff82111761036d57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161036d57601f01601f19166020019056
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.