NewroVault

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "contracts/Vault.sol": {
      "content": "// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.20;\r
\r
interface IERC20 {\r
    function transferFrom(address from, address to, uint256 value) external returns (bool);\r
    function transfer(address to, uint256 value) external returns (bool);\r
}\r
\r
contract NewroVault {\r
    IERC20 public immutable newroToken;   // The original Newro.sol contract\r
    address public owner;                 // Owner (you) who controls withdrawals\r
\r
    event Deposited(address indexed from, uint256 amount);\r
    event Withdrawn(address indexed to, uint256 amount);\r
\r
    modifier onlyOwner() {\r
        require(msg.sender == owner, "Not authorized");\r
        _;\r
    }\r
\r
    constructor(address _newroToken) {\r
        newroToken = IERC20(_newroToken);\r
        owner = msg.sender;\r
    }\r
\r
    // User deposits Newro into the vault (must approve first in Newro.sol)\r
    function deposit(uint256 amount) external {\r
        require(amount > 0, "Amount must be > 0");\r
        bool success = newroToken.transferFrom(msg.sender, address(this), amount);\r
        require(success, "Transfer failed");\r
        emit Deposited(msg.sender, amount);\r
    }\r
\r
    // Owner can release tokens back (later replaced by cross-chain burns)\r
    function withdraw(address to, uint256 amount) external onlyOwner {\r
        require(amount > 0, "Amount must be > 0");\r
        bool success = newroToken.transfer(to, amount);\r
        require(success, "Transfer failed");\r
        emit Withdrawn(to, amount);\r
    }\r
}\r
"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0xead84f0c14b9aa2403dbd50c72cb708fe5739b84|verified:true|block:23392454|tx:0xceabe7b6f36fde0703960621b86de82f1dc199b6a1198e058bff1cbfa4e34b23|first_check:1758274147

Submitted on: 2025-09-19 11:29:08

Comments

Log in to comment.

No comments yet.