PensionFundVault
0x78d668d04b400baa564890b87f304f38d4168411
Verification
Verified
v0.8.28+commit.7893614a
Type
Contract
1,593 bytes
ABI entries
21
4 read · 5 write
License
none
Contract information
- Address
- 0x78d668d04b400baa564890b87f304f38d4168411
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.28+commit.7893614a
- Optimization
- Enabled
- Creator
- 0x907Dbe35f1…24570010fb
- Creation tx
- 0xc6c117216c…95ca9a0b7a
Token
Not a token
This contract does not expose ERC-20 metadata.
Read contract (4)
currentEthBalance() → uint256
owner() → address
retirementManager() → address
totalEthReceived() → uint256
Events (5)
ERC20RescuedNativeEthReceivedNativeEthRescuedOwnershipTransferredRetirementManagerUpdated
ABI
[
{
"inputs": [
{
"internalType": "address",
"name": "initialOwner",
"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"
},
{
"inputs": [],
"name": "RescueFailed",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "SafeERC20FailedOperation",
"type": "error"
},
{
"inputs": [],
"name": "ZeroAddress",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "ERC20Rescued",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "totalEthReceived",
"type": "uint256"
}
],
"name": "NativeEthReceived",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "NativeEthRescued",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "retirementManager",
"type": "address"
}
],
"name": "RetirementManagerUpdated",
"type": "event"
},
{
"inputs": [],
"name": "currentEthBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"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": "contract IERC20",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "rescueERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "rescueNative",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "retirementManager",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newRetirementManager",
"type": "address"
}
],
"name": "setRetirementManager",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "totalEthReceived",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol";
contract PensionFundVault is Ownable {
using SafeERC20 for IERC20;
address public retirementManager;
uint256 public totalEthReceived;
event NativeEthReceived(address indexed sender, uint256 amount, uint256 totalEthReceived);
event RetirementManagerUpdated(address indexed retirementManager);
event NativeEthRescued(address indexed to, uint256 amount);
event ERC20Rescued(address indexed token, address indexed to, uint256 amount);
error ZeroAddress();
error RescueFailed();
constructor(address initialOwner) Ownable(initialOwner) {}
receive() external payable {
totalEthReceived += msg.value;
emit NativeEthReceived(msg.sender, msg.value, totalEthReceived);
}
function currentEthBalance() external view returns (uint256) {
return address(this).balance;
}
function setRetirementManager(address newRetirementManager) external onlyOwner {
retirementManager = newRetirementManager;
emit RetirementManagerUpdated(newRetirementManager);
}
function rescueNative(address payable to, uint256 amount) external onlyOwner {
if (to == address(0)) revert ZeroAddress();
(bool success,) = to.call{value: amount}("");
if (!success) revert RescueFailed();
emit NativeEthRescued(to, amount);
}
function rescueERC20(IERC20 token, address to, uint256 amount) external onlyOwner {
if (to == address(0)) revert ZeroAddress();
token.safeTransfer(to, amount);
emit ERC20Rescued(address(token), to, amount);
}
}
Chain explorer2022msChain node107ms