Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Register | 17543491 | 23 days ago | IN | 0 ETH | 0.00000629 |
Loading...
Loading
Contract Name:
SignatureVerifier
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "../components/Halt.sol";
import "../interfaces/ISignatureVerifier.sol";
/**
* @title IBaseSignVerifier
* @dev Interface for multi-curve signature verification
* This interface defines the standard verification method that all curve-specific verifiers must implement
*/
interface IBaseSignVerifier {
/**
* @notice Verifies a signature using the specified curve parameters
* @param signature The signature to verify
* @param groupKeyX X-coordinate of the group public key
* @param groupKeyY Y-coordinate of the group public key
* @param randomPointX X-coordinate of the random point
* @param randomPointY Y-coordinate of the random point
* @param message The message that was signed
* @return bool indicating whether the signature is valid
*/
function verify(
bytes32 signature,
bytes32 groupKeyX,
bytes32 groupKeyY,
bytes32 randomPointX,
bytes32 randomPointY,
bytes32 message
) external returns (bool);
}
/**
* @title SignatureVerifier
* @dev A contract that manages and routes signature verification requests to appropriate curve-specific verifiers
* This contract acts as a registry and router for different curve implementations
*/
contract SignatureVerifier is Halt {
/// @notice Mapping from curve ID to its corresponding verifier contract address
/// @dev Used to route verification requests to the appropriate curve implementation
mapping(uint256 => address) public verifierMap;
/**
* @notice Verifies a signature using the specified curve
* @dev Routes the verification request to the appropriate curve-specific verifier
* @param curveId The ID of the curve to use for verification
* @param signature The signature to verify
* @param groupKeyX X-coordinate of the group public key
* @param groupKeyY Y-coordinate of the group public key
* @param randomPointX X-coordinate of the random point
* @param randomPointY Y-coordinate of the random point
* @param message The message that was signed
* @return bool indicating whether the signature is valid
* @dev Throws if the curveId is not registered
*/
function verify(
uint256 curveId,
bytes32 signature,
bytes32 groupKeyX,
bytes32 groupKeyY,
bytes32 randomPointX,
bytes32 randomPointY,
bytes32 message
) external returns (bool) {
require(verifierMap[curveId] != address(0), "curveId not correct");
IBaseSignVerifier verifier = IBaseSignVerifier(verifierMap[curveId]);
return verifier.verify(signature, groupKeyX, groupKeyY, randomPointX, randomPointY, message);
}
/**
* @notice Registers a new curve verifier
* @dev Only callable by the contract owner
* @param curveId The ID of the curve to register
* @param verifierAddress The address of the curve-specific verifier contract
*/
function register(uint256 curveId, address verifierAddress) external onlyOwner {
verifierMap[curveId] = verifierAddress;
}
}// SPDX-License-Identifier: MIT
/*
Copyright 2023 Wanchain Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// _ _ _
// __ ____ _ _ __ ___| |__ __ _(_)_ __ __| | _____ __
// \ \ /\ / / _` | '_ \ / __| '_ \ / _` | | '_ \@/ _` |/ _ \ \ / /
// \ V V / (_| | | | | (__| | | | (_| | | | | | (_| | __/\ V /
// \_/\_/ \__,_|_| |_|\___|_| |_|\__,_|_|_| |_|\__,_|\___| \_/
//
//
pragma solidity ^0.8.18;
import './Owned.sol';
/**
* @title Halt
* @dev Contract for emergency stop functionality
* This contract provides functionality to halt and resume contract operations
* in emergency situations
*
* Key features:
* - Emergency stop mechanism
* - Access control through ownership
* - Modifiers for halted state checks
*
* @custom:security
* - Inherits Owned contract for ownership management
* - Only owner can halt/resume operations
* - State checks through modifiers
*/
contract Halt is Owned {
/**
* @dev Public state variable indicating if contract is halted
*
* @custom:usage
* - Controls contract operation state
* - Accessible for external queries
* - Modified through setHalt function
*/
bool public halted = false;
/**
* @dev Modifier to ensure contract is not halted
*
* @custom:requirements
* - Contract must not be in halted state
*
* @custom:reverts
* - If contract is halted
*/
modifier notHalted() {
require(!halted, "Smart contract is halted");
_;
}
/**
* @dev Modifier to ensure contract is halted
*
* @custom:requirements
* - Contract must be in halted state
*
* @custom:reverts
* - If contract is not halted
*/
modifier isHalted() {
require(halted, "Smart contract is not halted");
_;
}
/**
* @dev Sets the halted state of the contract
*
* @param halt Boolean indicating desired halted state
*
* @custom:requirements
* - Caller must be the contract owner
*
* @custom:effects
* - Updates halted state
* - Controls contract operation availability
*/
function setHalt(bool halt)
public
onlyOwner
{
halted = halt;
}
}// SPDX-License-Identifier: MIT
/*
Copyright 2023 Wanchain Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// _ _ _
// __ ____ _ _ __ ___| |__ __ _(_)_ __ __| | _____ __
// \ \ /\ / / _` | '_ \ / __| '_ \ / _` | | '_ \@/ _` |/ _ \ \ / /
// \ V V / (_| | | | | (__| | | | (_| | | | | | (_| | __/\ V /
// \_/\_/ \__,_|_| |_|\___|_| |_|\__,_|_|_| |_|\__,_|\___| \_/
//
//
pragma solidity ^0.8.18;
/**
* @title Owned
* @dev Base contract for ownership management
* This contract provides functionality for managing contract ownership
* with support for ownership transfer and renunciation
*
* Key features:
* - Ownership assignment
* - Ownership transfer
* - Ownership renunciation
* - Two-step ownership transfer
*
* @custom:security
* - Owner-only access control
* - Safe ownership transfer
* - Ownership renunciation capability
*/
contract Owned {
/**
* @dev Emitted when ownership is transferred
*
* @param previousOwner Address of the previous owner
* @param newOwner Address of the new owner
*/
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Modifier to restrict function access to owner only
*
* @custom:requirements
* - Caller must be the contract owner
*
* @custom:reverts
* - If caller is not the owner
*/
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
/**
* @dev Public state variable for contract owner
*
* @custom:usage
* - Stores current owner address
* - Accessible for external queries
* - Modified through ownership functions
*/
address public owner;
/**
* @dev Constructor assigns initial owner
*
* @custom:effects
* - Sets initial owner to contract deployer
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Public state variable for pending owner
*
* @custom:usage
* - Stores address of pending owner
* - Used in two-step ownership transfer
*/
address public newOwner;
/**
* @dev Transfers ownership to a new address
*
* @param _newOwner Address of the new owner
*
* @custom:requirements
* - Caller must be the current owner
* - New owner address must not be zero
*
* @custom:effects
* - Updates owner address
* - Emits OwnershipTransferred event
*/
function transferOwner(address _newOwner) public onlyOwner {
require(_newOwner != address(0), "New owner is the zero address");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
/**
* @dev Initiates two-step ownership transfer
*
* @param _newOwner Address of the new owner
*
* @custom:requirements
* - Caller must be the current owner
*
* @custom:effects
* - Sets pending owner address
*/
function changeOwner(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
/**
* @dev Accepts pending ownership transfer
*
* @custom:requirements
* - Caller must be the pending owner
*
* @custom:effects
* - Updates owner address to pending owner
*/
function acceptOwnership() public {
if (msg.sender == newOwner) {
owner = newOwner;
}
}
/**
* @dev Renounces ownership of the contract
*
* @custom:requirements
* - Caller must be the current owner
*
* @custom:effects
* - Sets owner to zero address
* - Makes contract unowned
*/
function renounceOwnership() public onlyOwner {
owner = address(0);
}
}// SPDX-License-Identifier: MIT
/*
Copyright 2023 Wanchain Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// _ _ _
// __ ____ _ _ __ ___| |__ __ _(_)_ __ __| | _____ __
// \ \ /\ / / _` | '_ \ / __| '_ \ / _` | | '_ \@/ _` |/ _ \ \ / /
// \ V V / (_| | | | | (__| | | | (_| | | | | | (_| | __/\ V /
// \_/\_/ \__,_|_| |_|\___|_| |_|\__,_|_|_| |_|\__,_|\___| \_/
//
//
pragma solidity ^0.8.18;
interface ISignatureVerifier {
function verify(
uint curveId,
bytes32 signature,
bytes32 groupKeyX,
bytes32 groupKeyY,
bytes32 randomPointX,
bytes32 randomPointY,
bytes32 message
) external returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"halted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"curveId","type":"uint256"},{"internalType":"address","name":"verifierAddress","type":"address"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"halt","type":"bool"}],"name":"setHalt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"verifierMap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"curveId","type":"uint256"},{"internalType":"bytes32","name":"signature","type":"bytes32"},{"internalType":"bytes32","name":"groupKeyX","type":"bytes32"},{"internalType":"bytes32","name":"groupKeyY","type":"bytes32"},{"internalType":"bytes32","name":"randomPointX","type":"bytes32"},{"internalType":"bytes32","name":"randomPointY","type":"bytes32"},{"internalType":"bytes32","name":"message","type":"bytes32"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040526001805460ff60a01b1916905534801561001d57600080fd5b50600080546001600160a01b031916331790556106698061003f6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063a6f9dae111610071578063a6f9dae114610126578063b9b8af0b14610139578063d4ee1d901461014d578063dbbdf08314610160578063f495438714610173578063f5d4d4701461018657600080fd5b80634587b7b4146100ae5780634fb2e45d146100d6578063715018a6146100eb57806379ba5097146100f35780638da5cb5b146100fb575b600080fd5b6100c16100bc3660046104f6565b6101af565b60405190151581526020015b60405180910390f35b6100e96100e436600461055e565b6102bc565b005b6100e9610397565b6100e96103d3565b60005461010e906001600160a01b031681565b6040516001600160a01b0390911681526020016100cd565b6100e961013436600461055e565b61040a565b6001546100c190600160a01b900460ff1681565b60015461010e906001600160a01b031681565b6100e961016e366004610580565b610456565b6100e96101813660046105bd565b6104ae565b61010e6101943660046105da565b6002602052600090815260409020546001600160a01b031681565b6000878152600260205260408120546001600160a01b031661020e5760405162461bcd60e51b815260206004820152601360248201527218dd5c9d995259081b9bdd0818dbdc9c9958dd606a1b60448201526064015b60405180910390fd5b6000888152600260205260409081902054905163060be1d760e21b8152600481018990526024810188905260448101879052606481018690526084810185905260a481018490526001600160a01b0390911690819063182f875c9060c4016020604051808303816000875af115801561028b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102af91906105f3565b9998505050505050505050565b6000546001600160a01b031633146102e65760405162461bcd60e51b815260040161020590610610565b6001600160a01b03811661033c5760405162461bcd60e51b815260206004820152601d60248201527f4e6577206f776e657220697320746865207a65726f20616464726573730000006044820152606401610205565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103c15760405162461bcd60e51b815260040161020590610610565b600080546001600160a01b0319169055565b6001546001600160a01b0316330361040857600154600080546001600160a01b0319166001600160a01b039092169190911790555b565b6000546001600160a01b031633146104345760405162461bcd60e51b815260040161020590610610565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146104805760405162461bcd60e51b815260040161020590610610565b60009182526002602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b031633146104d85760405162461bcd60e51b815260040161020590610610565b60018054911515600160a01b0260ff60a01b19909216919091179055565b600080600080600080600060e0888a03121561051157600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b80356001600160a01b038116811461055957600080fd5b919050565b60006020828403121561057057600080fd5b61057982610542565b9392505050565b6000806040838503121561059357600080fd5b823591506105a360208401610542565b90509250929050565b80151581146105ba57600080fd5b50565b6000602082840312156105cf57600080fd5b8135610579816105ac565b6000602082840312156105ec57600080fd5b5035919050565b60006020828403121561060557600080fd5b8151610579816105ac565b6020808252600990820152682737ba1037bbb732b960b91b60408201526060019056fea264697066735822122065efba661366998c6a9c07a84ecedf7d87f17f1bda4909baeb750d968d9eccb764736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063a6f9dae111610071578063a6f9dae114610126578063b9b8af0b14610139578063d4ee1d901461014d578063dbbdf08314610160578063f495438714610173578063f5d4d4701461018657600080fd5b80634587b7b4146100ae5780634fb2e45d146100d6578063715018a6146100eb57806379ba5097146100f35780638da5cb5b146100fb575b600080fd5b6100c16100bc3660046104f6565b6101af565b60405190151581526020015b60405180910390f35b6100e96100e436600461055e565b6102bc565b005b6100e9610397565b6100e96103d3565b60005461010e906001600160a01b031681565b6040516001600160a01b0390911681526020016100cd565b6100e961013436600461055e565b61040a565b6001546100c190600160a01b900460ff1681565b60015461010e906001600160a01b031681565b6100e961016e366004610580565b610456565b6100e96101813660046105bd565b6104ae565b61010e6101943660046105da565b6002602052600090815260409020546001600160a01b031681565b6000878152600260205260408120546001600160a01b031661020e5760405162461bcd60e51b815260206004820152601360248201527218dd5c9d995259081b9bdd0818dbdc9c9958dd606a1b60448201526064015b60405180910390fd5b6000888152600260205260409081902054905163060be1d760e21b8152600481018990526024810188905260448101879052606481018690526084810185905260a481018490526001600160a01b0390911690819063182f875c9060c4016020604051808303816000875af115801561028b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102af91906105f3565b9998505050505050505050565b6000546001600160a01b031633146102e65760405162461bcd60e51b815260040161020590610610565b6001600160a01b03811661033c5760405162461bcd60e51b815260206004820152601d60248201527f4e6577206f776e657220697320746865207a65726f20616464726573730000006044820152606401610205565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103c15760405162461bcd60e51b815260040161020590610610565b600080546001600160a01b0319169055565b6001546001600160a01b0316330361040857600154600080546001600160a01b0319166001600160a01b039092169190911790555b565b6000546001600160a01b031633146104345760405162461bcd60e51b815260040161020590610610565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146104805760405162461bcd60e51b815260040161020590610610565b60009182526002602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b031633146104d85760405162461bcd60e51b815260040161020590610610565b60018054911515600160a01b0260ff60a01b19909216919091179055565b600080600080600080600060e0888a03121561051157600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b80356001600160a01b038116811461055957600080fd5b919050565b60006020828403121561057057600080fd5b61057982610542565b9392505050565b6000806040838503121561059357600080fd5b823591506105a360208401610542565b90509250929050565b80151581146105ba57600080fd5b50565b6000602082840312156105cf57600080fd5b8135610579816105ac565b6000602082840312156105ec57600080fd5b5035919050565b60006020828403121561060557600080fd5b8151610579816105ac565b6020808252600990820152682737ba1037bbb732b960b91b60408201526060019056fea264697066735822122065efba661366998c6a9c07a84ecedf7d87f17f1bda4909baeb750d968d9eccb764736f6c63430008120033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.