Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60806040 | 24303261 | 62 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x5De6E497...08efCc9E4 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
WithdrawLocalGroth16Verifier
Compiler Version
v0.8.33+commit.64118f21
Optimization Enabled:
Yes with 200 runs
Other Settings:
prague EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/*
Copyright 2021 0KIMS association.
* `solidity-verifiers` added comment
This file is a template built out of [snarkJS](https://github.com/iden3/snarkjs) groth16 verifier.
See the original ejs template [here](https://github.com/iden3/snarkjs/blob/master/templates/verifier_groth16.sol.ejs)
*
snarkJS is a free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snarkJS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/
contract WithdrawLocalGroth16Verifier {
// Scalar field size
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
// Base field size
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
// Verification Key data
uint256 constant alphax = 10314683402145919335415264089338013869151872735661243528435829273762895412475;
uint256 constant alphay = 15311410802386913807174485311770598542990692773058369166097347676916826427424;
uint256 constant betax1 = 8742476040979126669529512667270167370972734897784767815803986702043271844587;
uint256 constant betax2 = 21546977338313367449764778081974431327514198880463503495700342085596869133184;
uint256 constant betay1 = 9289809140465907199790286310535739942219483053026485452107542051245760617369;
uint256 constant betay2 = 10645240371221413259645920038475973272479052146228783657329287031421083633145;
uint256 constant gammax1 = 19786488175694835941529082486176010093671788452701050737945948286615958246569;
uint256 constant gammax2 = 20330634461338860209244322586166193708999379153762374339780730602203574324967;
uint256 constant gammay1 = 5928072313096986966179943778308363878908435360419431578510684278352903202909;
uint256 constant gammay2 = 2797341508826357269065116312229379096387363396018049448422156015279464026096;
uint256 constant deltax1 = 15931872898476652233416341120558294461206602664690427226190761090136039762594;
uint256 constant deltax2 = 486543185197210868010625674188217166207603296241821390928288273180909083262;
uint256 constant deltay1 = 8810824702403597757041960647441338188287452861929357829520560151016180636116;
uint256 constant deltay2 = 20423055301853288990931997049485455849638502515255059322630657921443113246087;
uint256 constant IC0x = 5981170191792726018550786071194620221508954811380977324254400290854175013253;
uint256 constant IC0y = 7963352545678533703769588588119136330774730818542667732095523856920941509207;
uint256 constant IC1x = 20821657135676432889142208462570017708140579915257361314167309290885899903208;
uint256 constant IC1y = 11644784712562095374763108262330308260517779877916458745595529801600526776721;
uint256 constant IC2x = 1851457957886242515550697099551094984872412297309215389748394026781243764292;
uint256 constant IC2y = 18466285845908517752405622355001390565150981176040526649859134446727362915453;
uint256 constant IC3x = 3452574657221297304286562511070594155387565234735763151066981242551916564841;
uint256 constant IC3y = 17620257701175947555528870367770816985691621663381315377899926759899247136105;
// Memory data
uint16 constant pVk = 0;
uint16 constant pPairing = 128;
uint16 constant pLastMem = 896;
function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[3] calldata _pubSignals) public view returns (bool) {
assembly {
function checkField(v) {
if iszero(lt(v, r)) {
mstore(0, 0)
return(0, 0x20)
}
}
// G1 function to multiply a G1 value(x,y) to value in an address
function g1_mulAccC(pR, x, y, s) {
let success
let mIn := mload(0x40)
mstore(mIn, x)
mstore(add(mIn, 32), y)
mstore(add(mIn, 64), s)
success := staticcall(sub(gas(), 2000), 7, mIn, 96, mIn, 64)
if iszero(success) {
mstore(0, 0)
return(0, 0x20)
}
mstore(add(mIn, 64), mload(pR))
mstore(add(mIn, 96), mload(add(pR, 32)))
success := staticcall(sub(gas(), 2000), 6, mIn, 128, pR, 64)
if iszero(success) {
mstore(0, 0)
return(0, 0x20)
}
}
function checkPairing(pA, pB, pC, pubSignals, pMem) -> isOk {
let _pPairing := add(pMem, pPairing)
let _pVk := add(pMem, pVk)
mstore(_pVk, IC0x)
mstore(add(_pVk, 32), IC0y)
// Compute the linear combination vk_x
g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))
g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))
g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))
// -A
mstore(_pPairing, calldataload(pA))
mstore(add(_pPairing, 32), mod(sub(q, calldataload(add(pA, 32))), q))
// B
mstore(add(_pPairing, 64), calldataload(pB))
mstore(add(_pPairing, 96), calldataload(add(pB, 32)))
mstore(add(_pPairing, 128), calldataload(add(pB, 64)))
mstore(add(_pPairing, 160), calldataload(add(pB, 96)))
// alpha1
mstore(add(_pPairing, 192), alphax)
mstore(add(_pPairing, 224), alphay)
// beta2
mstore(add(_pPairing, 256), betax1)
mstore(add(_pPairing, 288), betax2)
mstore(add(_pPairing, 320), betay1)
mstore(add(_pPairing, 352), betay2)
// vk_x
mstore(add(_pPairing, 384), mload(add(pMem, pVk)))
mstore(add(_pPairing, 416), mload(add(pMem, add(pVk, 32))))
// gamma2
mstore(add(_pPairing, 448), gammax1)
mstore(add(_pPairing, 480), gammax2)
mstore(add(_pPairing, 512), gammay1)
mstore(add(_pPairing, 544), gammay2)
// C
mstore(add(_pPairing, 576), calldataload(pC))
mstore(add(_pPairing, 608), calldataload(add(pC, 32)))
// delta2
mstore(add(_pPairing, 640), deltax1)
mstore(add(_pPairing, 672), deltax2)
mstore(add(_pPairing, 704), deltay1)
mstore(add(_pPairing, 736), deltay2)
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
isOk := and(success, mload(_pPairing))
}
let pMem := mload(0x40)
mstore(0x40, add(pMem, pLastMem))
// Validate that all evaluations ∈ F
checkField(calldataload(add(_pubSignals, 0)))
checkField(calldataload(add(_pubSignals, 32)))
checkField(calldataload(add(_pubSignals, 64)))
checkField(calldataload(add(_pubSignals, 96)))
// Validate all evaluations
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
mstore(0, isValid)
return(0, 0x20)
}
}
}{
"remappings": [
"@layerzerolabs/lz-evm-messagelib-v2/=dependencies/@layerzerolabs-lz-evm-messagelib-v2-3.0.152/",
"@layerzerolabs/lz-evm-protocol-v2/=dependencies/@layerzerolabs-lz-evm-protocol-v2-3.0.152/",
"@layerzerolabs/lz-evm-v1-0.7/=dependencies/@layerzerolabs-lz-evm-v1-0-7-3.0.152/",
"@layerzerolabs/oapp-evm-upgradeable/=dependencies/@layerzerolabs-oapp-evm-upgradeable-0.1.3/",
"@layerzerolabs/oapp-evm/=dependencies/@layerzerolabs-oapp-evm-0.4.1/",
"@layerzerolabs/oft-evm-upgradeable/=dependencies/@layerzerolabs-oft-evm-upgradeable-4.0.2/",
"@layerzerolabs/oft-evm/=dependencies/@layerzerolabs-oft-evm-4.0.1/",
"@layerzerolabs/test-devtools-evm-foundry/=dependencies/@layerzerolabs-test-devtools-evm-foundry-8.0.1/",
"@openzeppelin/contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.6.0-rc.0/",
"@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.6.0-rc.0/",
"forge-std/=dependencies/forge-std-1.14.0/src/",
"lz-address-book/=dependencies/lz-address-book-1.0.0/src/",
"poseidon-solidity/contracts/=dependencies/poseidon-solidity-0.0.5/",
"solady-0.1.8/=dependencies/solady-0.1.8/",
"solidity-bytes-utils/=dependencies/gnsps-solidity-bytes-utils-0.8.4/",
"@layerzerolabs-lz-evm-messagelib-v2-3.0.152/=dependencies/@layerzerolabs-lz-evm-messagelib-v2-3.0.152/contracts/",
"@layerzerolabs-lz-evm-protocol-v2-3.0.152/=dependencies/@layerzerolabs-lz-evm-protocol-v2-3.0.152/contracts/",
"@layerzerolabs-lz-evm-v1-0-7-3.0.152/=dependencies/@layerzerolabs-lz-evm-v1-0-7-3.0.152/contracts/",
"@layerzerolabs-oapp-evm-0.4.1/=dependencies/@layerzerolabs-oapp-evm-0.4.1/contracts/",
"@layerzerolabs-oapp-evm-upgradeable-0.1.3/=dependencies/@layerzerolabs-oapp-evm-upgradeable-0.1.3/contracts/",
"@layerzerolabs-oft-evm-4.0.1/=dependencies/@layerzerolabs-oft-evm-4.0.1/contracts/",
"@layerzerolabs-oft-evm-upgradeable-4.0.2/=dependencies/@layerzerolabs-oft-evm-upgradeable-4.0.2/contracts/",
"@layerzerolabs-test-devtools-evm-foundry-8.0.1/=dependencies/@layerzerolabs-test-devtools-evm-foundry-8.0.1/contracts/",
"@openzeppelin-contracts-5.6.0-rc.0/=dependencies/@openzeppelin-contracts-5.6.0-rc.0/",
"@openzeppelin-contracts-upgradeable-5.6.0-rc.0/=dependencies/@openzeppelin-contracts-upgradeable-5.6.0-rc.0/",
"forge-std-1.14.0/=dependencies/forge-std-1.14.0/src/",
"gnsps-solidity-bytes-utils-0.8.4/=dependencies/gnsps-solidity-bytes-utils-0.8.4/contracts/",
"lz-address-book-1.0.0/=dependencies/lz-address-book-1.0.0/src/",
"poseidon-solidity-0.0.5/=dependencies/poseidon-solidity-0.0.5/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "prague",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"uint256[2]","name":"_pA","type":"uint256[2]"},{"internalType":"uint256[2][2]","name":"_pB","type":"uint256[2][2]"},{"internalType":"uint256[2]","name":"_pC","type":"uint256[2]"},{"internalType":"uint256[3]","name":"_pubSignals","type":"uint256[3]"}],"name":"verifyProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x6080604052348015600e575f5ffd5b5061060f8061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610029575f3560e01c806311479fea1461002d575b5f5ffd5b61004061003b366004610577565b610054565b604051901515815260200160405180910390f35b5f61050c565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018110610089575f5f5260205ff35b50565b5f60405183815284602082015285604082015260408160608360076107d05a03fa9150816100bc575f5f5260205ff35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100eb575f5f5260205ff35b5050505050565b7f0d3938eca31642e9ffd03127c959ef87713c9034895f4b03abcc7cffa2a8798585527f119b190a6cdbf90eba3dccb4c6091d96bdb52d74f6c050d87d1cf805f0753a5760208601525f608086018661018e87357f19beb6eecaebe24fbe59bbf9d481703e449b4390f5511f975c18c76dffe0f9917f2e08a3eb26cc6a18d0f11d7624bbfa879e139493889a3cf4feecbd2efdd060e88461008c565b6101de60208801357f28d38c226663be4897666bdc7f0e293a9a8926ed9bda3488fa1cda0d2fda2c7d7f0417e3587388efbf349109b5113bd0e2fb640afcde64a3ca3a9f904ff8566e448461008c565b61022e60408801357f26f4b6626b4314214870a2513b235823f294e0ca8b4463079ef53329ab7fcd697f07a216878af030c0bc1006b8bc9a3f745c9b45517f03a7273465a5ebdca411698461008c565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f16cde7672d240777d5e1e109af2a17cf9c6f65aabd05a76d82461ed92edabcfb60c08201527f21d9f38f3d392cb6605fe0986b27e2ce9c23dc0b8936d7af05eb213dfdaed02060e08201527f135410eb08cc99678e973f836aac67573b37106e8f6b65ddc7b2976fc16ad2eb6101008201527f2fa32830b84e4463e4dede31a16278eb742416eae4bef6b156903587cff983806101208201527f1489d87c0678fe268212b8a9f9e57aa5ee218a972b6aa066a6d9229f4fea9b996101408201527f1788fe169ad482a20fd2c4a70f3c65a55fed2022df58aca286c1acdf8c34c5f96101608201525f87015161018082015260205f018701516101a08201527f2bbec1646afc4b6f9eaa3926da6b62021e69922d4f2ffcacf2896a7bb636d4a96101c08201527f2cf2bb37e9ec0305b71e42f5cfb5a6117a30ba1086fa0600a9720def28ba4ee76101e08201527f0d1b2b86dac682bd0e36ee8de9c63750ffeeb520c92681976e362d1b3dc0e85d6102008201527f062f3d3b4d162be8243a46c651e1fe735841bcaed0b7b2ec9d4979fa97d48ff0610220820152843561024082015260208501356102608201527f23391ed97851cfb5d0bb6bc901ec00feaa36235fac6a8dba43d0ee75e12c2aa26102808201527f01135fa9c047229ca25627c2bf2194c043e03f34a8f6cc94b5ff1d61f19b9a7e6102a08201527f137ac003c9aff19bd67336083096af7eee88535985cbb6e0b40d74e8404559d46102c08201527f2d270a276a2590d9e1b2b8bd70447b7880e92942981c2b0136ac58bafb389d876102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526105235f84013561005a565b610530602084013561005a565b61053d604084013561005a565b61054a606084013561005a565b610557818486888a6100f2565b9050805f5260205ff35b8060408101831015610571575f5ffd5b92915050565b5f5f5f5f610160858703121561058b575f5ffd5b6105958686610561565b935060c08501868111156105a7575f5ffd5b6040860193506105b78782610561565b92505085610160860111156105ca575f5ffd5b5091949093509091610100019056fea2646970667358221220373b135e34940d583b3addf14b489d23a1324dc13b338a1cec371f82652975d664736f6c63430008210033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610029575f3560e01c806311479fea1461002d575b5f5ffd5b61004061003b366004610577565b610054565b604051901515815260200160405180910390f35b5f61050c565b7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018110610089575f5f5260205ff35b50565b5f60405183815284602082015285604082015260408160608360076107d05a03fa9150816100bc575f5f5260205ff35b825160408201526020830151606082015260408360808360066107d05a03fa915050806100eb575f5f5260205ff35b5050505050565b7f0d3938eca31642e9ffd03127c959ef87713c9034895f4b03abcc7cffa2a8798585527f119b190a6cdbf90eba3dccb4c6091d96bdb52d74f6c050d87d1cf805f0753a5760208601525f608086018661018e87357f19beb6eecaebe24fbe59bbf9d481703e449b4390f5511f975c18c76dffe0f9917f2e08a3eb26cc6a18d0f11d7624bbfa879e139493889a3cf4feecbd2efdd060e88461008c565b6101de60208801357f28d38c226663be4897666bdc7f0e293a9a8926ed9bda3488fa1cda0d2fda2c7d7f0417e3587388efbf349109b5113bd0e2fb640afcde64a3ca3a9f904ff8566e448461008c565b61022e60408801357f26f4b6626b4314214870a2513b235823f294e0ca8b4463079ef53329ab7fcd697f07a216878af030c0bc1006b8bc9a3f745c9b45517f03a7273465a5ebdca411698461008c565b50823581527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4760208401357f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4703066020820152833560408201526020840135606082015260408401356080820152606084013560a08201527f16cde7672d240777d5e1e109af2a17cf9c6f65aabd05a76d82461ed92edabcfb60c08201527f21d9f38f3d392cb6605fe0986b27e2ce9c23dc0b8936d7af05eb213dfdaed02060e08201527f135410eb08cc99678e973f836aac67573b37106e8f6b65ddc7b2976fc16ad2eb6101008201527f2fa32830b84e4463e4dede31a16278eb742416eae4bef6b156903587cff983806101208201527f1489d87c0678fe268212b8a9f9e57aa5ee218a972b6aa066a6d9229f4fea9b996101408201527f1788fe169ad482a20fd2c4a70f3c65a55fed2022df58aca286c1acdf8c34c5f96101608201525f87015161018082015260205f018701516101a08201527f2bbec1646afc4b6f9eaa3926da6b62021e69922d4f2ffcacf2896a7bb636d4a96101c08201527f2cf2bb37e9ec0305b71e42f5cfb5a6117a30ba1086fa0600a9720def28ba4ee76101e08201527f0d1b2b86dac682bd0e36ee8de9c63750ffeeb520c92681976e362d1b3dc0e85d6102008201527f062f3d3b4d162be8243a46c651e1fe735841bcaed0b7b2ec9d4979fa97d48ff0610220820152843561024082015260208501356102608201527f23391ed97851cfb5d0bb6bc901ec00feaa36235fac6a8dba43d0ee75e12c2aa26102808201527f01135fa9c047229ca25627c2bf2194c043e03f34a8f6cc94b5ff1d61f19b9a7e6102a08201527f137ac003c9aff19bd67336083096af7eee88535985cbb6e0b40d74e8404559d46102c08201527f2d270a276a2590d9e1b2b8bd70447b7880e92942981c2b0136ac58bafb389d876102e08201526020816103008360086107d05a03fa9051169695505050505050565b60405161038081016040526105235f84013561005a565b610530602084013561005a565b61053d604084013561005a565b61054a606084013561005a565b610557818486888a6100f2565b9050805f5260205ff35b8060408101831015610571575f5ffd5b92915050565b5f5f5f5f610160858703121561058b575f5ffd5b6105958686610561565b935060c08501868111156105a7575f5ffd5b6040860193506105b78782610561565b92505085610160860111156105ca575f5ffd5b5091949093509091610100019056fea2646970667358221220373b135e34940d583b3addf14b489d23a1324dc13b338a1cec371f82652975d664736f6c63430008210033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 32 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.