Smart contract

0xe3b01162B94ab9D4B52b62b87aD9f8666DD66A38
Native balance0USDX
Account typeSmart contract
NetworkTuven 99359

Overview

Verification
Not verified
Balance updated at block
16786

Verified contract source

Verified
Contract name
Multisig1of2
Compiler
v0.8.29+commit.ab55807c
EVM version
prague
License
none
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/// @notice 1-of-2 multisig: either signer can act alone.
contract Multisig1of2 {
    address public signerA;
    address public signerB;

    event SignerRotated(address indexed oldSigner, address indexed newSigner);

    error NotSigner();
    error ZeroAddress();
    error UnknownSigner();
    error DuplicateSigner();

    modifier onlySigner() {
        if (msg.sender != signerA && msg.sender != signerB) revert NotSigner();
        _;
    }

    constructor(address _signerA, address _signerB) {
        if (_signerA == address(0) || _signerB == address(0)) revert ZeroAddress();
        if (_signerA == _signerB) revert DuplicateSigner();
        signerA = _signerA;
        signerB = _signerB;
    }

    function isSigner(address who) external view returns (bool) {
        return who == signerA || who == signerB;
    }

    /// @notice Rotate one of the two signer slots. Either signer may call.
    function rotateSigner(address oldSigner, address newSigner) external onlySigner {
        if (newSigner == address(0)) revert ZeroAddress();
        if (newSigner == signerA || newSigner == signerB) revert DuplicateSigner();
        if (oldSigner == signerA) {
            signerA = newSigner;
        } else if (oldSigner == signerB) {
            signerB = newSigner;
        } else {
            revert UnknownSigner();
        }
        emit SignerRotated(oldSigner, newSigner);
    }

    /// @notice Execute an arbitrary call from this multisig. Either signer may invoke.
    function execute(address target, uint256 value, bytes calldata data)
        external
        payable
        onlySigner
        returns (bytes memory result)
    {
        bool ok;
        (ok, result) = target.call{value: value}(data);
        if (!ok) {
            assembly {
                revert(add(result, 0x20), mload(result))
            }
        }
    }

    receive() external payable {}
}
Contract ABI
JSON
[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "_signerA",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "_signerB",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "DuplicateSigner",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "NotSigner",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "UnknownSigner",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "ZeroAddress",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "oldSigner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "newSigner",
        "type": "address"
      }
    ],
    "name": "SignerRotated",
    "type": "event"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "target",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      },
      {
        "internalType": "bytes",
        "name": "data",
        "type": "bytes"
      }
    ],
    "name": "execute",
    "outputs": [
      {
        "internalType": "bytes",
        "name": "result",
        "type": "bytes"
      }
    ],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "who",
        "type": "address"
      }
    ],
    "name": "isSigner",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "oldSigner",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "newSigner",
        "type": "address"
      }
    ],
    "name": "rotateSigner",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "signerA",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "signerB",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "stateMutability": "payable",
    "type": "receive"
  }
]

YOUR GATEWAY TO TUVEN

Connect to possibility.

Choose a wallet. Your assets stay in your control.

No wallet detected. On mobile, open this page in your wallet’s built-in browser.
Get MetaMask

Tuven · Chain 99359 · USDX