Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- SignatureVerifier
- Optimization enabled
- true
- Compiler version
- v0.4.26+commit.4563c3fc
- Optimization runs
- 200
- EVM Version
- byzantium
- Verified at
- 2023-04-19T10:21:45.361975Z
Contract source code
// File: contracts/interfaces/ISignatureVerifier.sol /* Copyright 2019 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.4.26; interface ISignatureVerifier { function verify( uint curveId, bytes32 signature, bytes32 groupKeyX, bytes32 groupKeyY, bytes32 randomPointX, bytes32 randomPointY, bytes32 message ) external returns (bool); } // File: contracts/components/Owned.sol /* Copyright 2019 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.4.24; /// @dev `Owned` is a base level contract that assigns an `owner` that can be /// later changed contract Owned { event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /// @dev `owner` is the only address that can call a function with this /// modifier modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } address public owner; /// @notice The Constructor assigns the message sender to be `owner` constructor() public { owner = msg.sender; } address public newOwner; function transferOwner(address _newOwner) public onlyOwner { require(_newOwner != address(0), "New owner is the zero address"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } /// @notice `owner` can step down and assign some other address to this role /// @param _newOwner The address of the new owner. 0x0 can be used to create /// an unowned neutral vault, however that cannot be undone function changeOwner(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { if (msg.sender == newOwner) { owner = newOwner; } } function renounceOwnership() public onlyOwner { owner = address(0); } } // File: contracts/components/Halt.sol /* Copyright 2019 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.4.24; contract Halt is Owned { bool public halted = false; modifier notHalted() { require(!halted, "Smart contract is halted"); _; } modifier isHalted() { require(halted, "Smart contract is not halted"); _; } /// @notice function Emergency situation that requires /// @notice contribution period to stop or not. function setHalt(bool halt) public onlyOwner { halted = halt; } } // File: contracts/schnorr/SignatureVerifier.sol pragma solidity ^0.4.24; /// @dev for multi curves contract call. interface IBaseSignVerifier { function verify( bytes32 signature, bytes32 groupKeyX, bytes32 groupKeyY, bytes32 randomPointX, bytes32 randomPointY, bytes32 message ) external returns (bool); } contract SignatureVerifier is Halt { /// @dev a map from a uint256 curveId to it's verifier contract address. mapping(uint256 => address) public verifierMap; /// @dev verify is used for check signature. 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); } function register(uint256 curveId, address verifierAddress) external onlyOwner { verifierMap[curveId] = verifierAddress; } }
Contract ABI
[{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"bool","name":""}],"name":"verify","inputs":[{"type":"uint256","name":"curveId"},{"type":"bytes32","name":"signature"},{"type":"bytes32","name":"groupKeyX"},{"type":"bytes32","name":"groupKeyY"},{"type":"bytes32","name":"randomPointX"},{"type":"bytes32","name":"randomPointY"},{"type":"bytes32","name":"message"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"transferOwner","inputs":[{"type":"address","name":"_newOwner"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"renounceOwnership","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"acceptOwnership","inputs":[],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"owner","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"changeOwner","inputs":[{"type":"address","name":"_newOwner"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"halted","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"newOwner","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"register","inputs":[{"type":"uint256","name":"curveId"},{"type":"address","name":"verifierAddress"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setHalt","inputs":[{"type":"bool","name":"halt"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"verifierMap","inputs":[{"type":"uint256","name":""}],"constant":true},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","indexed":true},{"type":"address","name":"newOwner","indexed":true}],"anonymous":false}]
Contract Creation Code
0x60806040526001805460a060020a60ff021916905560008054600160a060020a0319163317905561075c806100356000396000f3006080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416634587b7b481146100b35780634fb2e45d146100f1578063715018a61461011457806379ba5097146101295780638da5cb5b1461013e578063a6f9dae11461016f578063b9b8af0b14610190578063d4ee1d90146101a5578063dbbdf083146101ba578063f4954387146101de578063f5d4d470146101f8575b600080fd5b3480156100bf57600080fd5b506100dd60043560243560443560643560843560a43560c435610210565b604080519115158252519081900360200190f35b3480156100fd57600080fd5b50610112600160a060020a0360043516610350565b005b34801561012057600080fd5b50610112610468565b34801561013557600080fd5b506101126104d7565b34801561014a57600080fd5b5061015361051c565b60408051600160a060020a039092168252519081900360200190f35b34801561017b57600080fd5b50610112600160a060020a036004351661052b565b34801561019c57600080fd5b506100dd6105aa565b3480156101b157600080fd5b506101536105cb565b3480156101c657600080fd5b50610112600435600160a060020a03602435166105da565b3480156101ea57600080fd5b506101126004351515610665565b34801561020457600080fd5b506101536004356106f5565b6000878152600260205260408120548190600160a060020a03161515610280576040805160e560020a62461bcd02815260206004820152601360248201527f63757276654964206e6f7420636f727265637400000000000000000000000000604482015290519081900360640190fd5b5060008881526002602090815260408083205481517f182f875c000000000000000000000000000000000000000000000000000000008152600481018c9052602481018b9052604481018a9052606481018990526084810188905260a481018790529151600160a060020a0390911693849363182f875c9360c4808201949293918390030190829087803b15801561031757600080fd5b505af115801561032b573d6000803e3d6000fd5b505050506040513d602081101561034157600080fd5b50519998505050505050505050565b600054600160a060020a031633146103a0576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b600160a060020a0381161515610400576040805160e560020a62461bcd02815260206004820152601d60248201527f4e6577206f776e657220697320746865207a65726f2061646472657373000000604482015290519081900360640190fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031633146104b8576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600154600160a060020a031633141561051a576001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b600054600160a060020a031681565b600054600160a060020a0316331461057b576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015474010000000000000000000000000000000000000000900460ff1681565b600154600160a060020a031681565b600054600160a060020a0316331461062a576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b600091825260026020526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031633146106b5576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b60018054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600260205260009081526040902054600160a060020a03168156004e6f74206f776e65720000000000000000000000000000000000000000000000a165627a7a72305820caa8a20e0ac4eebf3966c3d95c44b7ba8f70046493b13bc9adc03121e5d285e60029
Deployed ByteCode
0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416634587b7b481146100b35780634fb2e45d146100f1578063715018a61461011457806379ba5097146101295780638da5cb5b1461013e578063a6f9dae11461016f578063b9b8af0b14610190578063d4ee1d90146101a5578063dbbdf083146101ba578063f4954387146101de578063f5d4d470146101f8575b600080fd5b3480156100bf57600080fd5b506100dd60043560243560443560643560843560a43560c435610210565b604080519115158252519081900360200190f35b3480156100fd57600080fd5b50610112600160a060020a0360043516610350565b005b34801561012057600080fd5b50610112610468565b34801561013557600080fd5b506101126104d7565b34801561014a57600080fd5b5061015361051c565b60408051600160a060020a039092168252519081900360200190f35b34801561017b57600080fd5b50610112600160a060020a036004351661052b565b34801561019c57600080fd5b506100dd6105aa565b3480156101b157600080fd5b506101536105cb565b3480156101c657600080fd5b50610112600435600160a060020a03602435166105da565b3480156101ea57600080fd5b506101126004351515610665565b34801561020457600080fd5b506101536004356106f5565b6000878152600260205260408120548190600160a060020a03161515610280576040805160e560020a62461bcd02815260206004820152601360248201527f63757276654964206e6f7420636f727265637400000000000000000000000000604482015290519081900360640190fd5b5060008881526002602090815260408083205481517f182f875c000000000000000000000000000000000000000000000000000000008152600481018c9052602481018b9052604481018a9052606481018990526084810188905260a481018790529151600160a060020a0390911693849363182f875c9360c4808201949293918390030190829087803b15801561031757600080fd5b505af115801561032b573d6000803e3d6000fd5b505050506040513d602081101561034157600080fd5b50519998505050505050505050565b600054600160a060020a031633146103a0576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b600160a060020a0381161515610400576040805160e560020a62461bcd02815260206004820152601d60248201527f4e6577206f776e657220697320746865207a65726f2061646472657373000000604482015290519081900360640190fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031633146104b8576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600154600160a060020a031633141561051a576001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b600054600160a060020a031681565b600054600160a060020a0316331461057b576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015474010000000000000000000000000000000000000000900460ff1681565b600154600160a060020a031681565b600054600160a060020a0316331461062a576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b600091825260026020526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600054600160a060020a031633146106b5576040805160e560020a62461bcd0281526020600482015260096024820152600080516020610711833981519152604482015290519081900360640190fd5b60018054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600260205260009081526040902054600160a060020a03168156004e6f74206f776e65720000000000000000000000000000000000000000000000a165627a7a72305820caa8a20e0ac4eebf3966c3d95c44b7ba8f70046493b13bc9adc03121e5d285e60029