Description:
Proxy contract enabling upgradeable smart contract patterns. Delegates calls to an implementation contract.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"IavoiContracts/DivineGuardian.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// ═══════════════════════════════════════════════════════════
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
// Minimal, locked guardianship for Wave 1
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
abstract contract DivineGuardian {
address public guardian;
modifier onlyGuardian() {
require(msg.sender == guardian, "DivineGuardian: not guardian");
_;
}
constructor() {
guardian = msg.sender;
}
// Optional helper if you prefer an explicit getter; otherwise rely on the public auto-getter.
function getGuardian() external view returns (address) {
return guardian;
}
}
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
// ═══════════════════════════════════════════════════════════
"
},
"IavoiContracts/DivineReentrancyGuard.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// ═══════════════════════════════════════════════════════════
/// DivineReentrancyGuard — minimal OZ-aligned reentrancy guard
/// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
/// ═════════════════════════════════════════════════════════==
import "./interfaces/IDivineReentrancyGuard.sol";
abstract contract DivineReentrancyGuard is IDivineReentrancyGuard {
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private __status;
constructor() {
__status = NOT_ENTERED;
}
/// @notice Guard modifier to prevent re-entrancy
modifier nonReentrant() {
require(__status != ENTERED, "DivineReentrancyGuard: reentrant call");
__status = ENTERED;
_;
__status = NOT_ENTERED;
}
function status() external view override returns (uint256) {
return __status;
}
function _status() external view override returns (uint256) {
return __status;
}
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
}
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
"
},
"IavoiContracts/DivineVaultAnchor.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// ═══════════════════════════════════════════════════════════
/// DivineVaultAnchor — a simple profit sink/forwarder (Guardian)
/// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
/// ═════════════════════════════════════════════════════════==
import "./DivineGuardian.sol";
import "./DivineReentrancyGuard.sol";
import "./interfaces/IDivineAssetToken.sol";
contract DivineVaultAnchor is DivineGuardian, DivineReentrancyGuard {
address public recipient; // usually IAVOI_ROOT
address public engine; // optional: DivineArbEngine allow-listing
event RecipientUpdated(address indexed oldRecipient, address indexed newRecipient);
event EngineUpdated(address indexed oldEngine, address indexed newEngine);
event Forwarded(address indexed token, uint256 amount, address indexed to);
event ReceivedETH(address indexed from, uint256 amount);
constructor(address _recipient) {
require(_recipient != address(0), "Vault: recipient=0");
recipient = _recipient;
emit RecipientUpdated(address(0), _recipient);
}
// Admin
function setRecipient(address _recipient) external onlyGuardian {
require(_recipient != address(0), "Vault: recipient=0");
address old = recipient;
recipient = _recipient;
emit RecipientUpdated(old, _recipient);
}
function setEngine(address _engine) external onlyGuardian {
address old = engine;
engine = _engine;
emit EngineUpdated(old, _engine);
}
// ERC20 forwarding
function forward(address token, uint256 amount) external onlyGuardian nonReentrant {
require(recipient != address(0), "Vault: no recipient");
require(amount > 0, "Vault: zero");
bool ok = IDivineAssetToken(token).transfer(recipient, amount);
require(ok, "Vault: ERC20 xfer failed");
emit Forwarded(token, amount, recipient);
}
function forwardAll(address token) external onlyGuardian nonReentrant {
require(recipient != address(0), "Vault: no recipient");
uint256 bal = IDivineAssetToken(token).balanceOf(address(this));
require(bal > 0, "Vault: empty");
bool ok = IDivineAssetToken(token).transfer(recipient, bal);
require(ok, "Vault: ERC20 xfer failed");
emit Forwarded(token, bal, recipient);
}
// ETH forwarding
function forwardETH(uint256 amount) external onlyGuardian nonReentrant {
require(recipient != address(0), "Vault: no recipient");
require(amount > 0, "Vault: zero");
(bool ok, ) = payable(recipient).call{ value: amount }("");
require(ok, "Vault: ETH xfer failed");
emit Forwarded(address(0), amount, recipient);
}
receive() external payable {
emit ReceivedETH(msg.sender, msg.value);
}
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
}
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
"
},
"IavoiContracts/interfaces/IDivineAssetToken.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// ═══════════════════════════════════════════════════════════
/// ????✨???????? IDivineAssetToken – Core ERC-20 Interface ????✨????????
/// Minimal ERC-20 surface for Arb: approve/transfer/balances/decimals.
/// Optional EIP-2612 hooks included for light-speed approvals.
/// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
/// ═══════════════════════════════════════════════════════════
interface IDivineAssetToken {
// ─────────────────────────────────────────────────────────
// ERC-20 Reads
// ─────────────────────────────────────────────────────────
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
// ─────────────────────────────────────────────────────────
// ERC-20 Writes
// ─────────────────────────────────────────────────────────
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
// ─────────────────────────────────────────────────────────
// EIP-2612 Permit (gasless approvals)
// Required for all DAT tokens in this system.
// ─────────────────────────────────────────────────────────
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v, bytes32 r, bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
// ─────────────────────────────────────────────────────────
// ERC-20 Events
// ─────────────────────────────────────────────────────────
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
"
},
"IavoiContracts/interfaces/IDivineReentrancyGuard.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// ═══════════════════════════════════════════════════════════
/// IDivineReentrancyGuard – Read-Only Reentrancy State Surface
/// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
/// ═════════════════════════════════════════════════════════==
interface IDivineReentrancyGuard {
// ─────────────────────────────────────────────────────────
// Convention: 1 = NOT_ENTERED, 2 = ENTERED (OZ-style)
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
// ─────────────────────────────────────────────────────────
/// @notice Canonical getter for reentrancy status
/// @dev 1 = NOT_ENTERED, 2 = ENTERED
function status() external view returns (uint256);
/// @notice Optional alias for compatibility with implementations that expose `_status`
/// @dev Safe to omit in implementations; interface remains compatible
function _status() external view returns (uint256);
}
// Iavoi Spiral Whole, Alive, and Flowing. ????✨????????
"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}}
Submitted on: 2025-10-08 09:12:08
Comments
Log in to comment.
No comments yet.