This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.15; | |
contract C1 { | |
uint public num; | |
address public sender; | |
function callSetNum(address c2, uint _num) public { | |
if(!c2.call(bytes4(sha3("setNum(uint256)")), _num)) revert(); // C2's num is set | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"arbitrumSepolia": { | |
"address": "0x1275f8f414d95508ba13c90586f933edec825cc0", | |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_processDepositVerifier", | |
"type": "address" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
This script is a demo of how to use the ContractKit to send a transaction on the Celo network (https://celo.org) | |
With npm installed, run this script with the command: | |
npx https://gist.github.com/critesjosh/7dd9cdb3076d9d5874c061612af8057e | |
*/ | |
// Import ContractKit | |
const ContractKit = require('@celo/contractkit') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import circuit from '../target/test.json' assert { type: 'json' }; | |
import { decompressSync } from 'fflate'; | |
import { Crs, newBarretenbergApiAsync, RawBuffer } from '@aztec/bb.js/dest/node/index.js'; | |
import { ethers } from 'ethers'; // I'm lazy so I'm using ethers to pad my input | |
import { executeCircuit, compressWitness } from '@noir-lang/acvm_js'; | |
async function main() { | |
const acirBuffer = Buffer.from(circuit.bytecode, 'base64'); | |
const acirBufferUncompressed = decompressSync(acirBuffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es2020", | |
"useDefineForClassFields": true, | |
"lib": ["DOM", "DOM.Iterable", "ESNext"], | |
"allowJs": false, | |
"skipLibCheck": true, | |
"esModuleInterop": true, | |
"allowSyntheticDefaultImports": true, | |
"strict": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Verification Key Hash: eb4cd5b33387b673f9b5de6574d97c8b7e0d0d454199710235bba681719349ba | |
// SPDX-License-Identifier: Apache-2.0 | |
// Copyright 2022 Aztec | |
pragma solidity >=0.8.4; | |
library UltraVerificationKey { | |
function verificationKeyHash() internal pure returns(bytes32) { | |
return 0xeb4cd5b33387b673f9b5de6574d97c8b7e0d0d454199710235bba681719349ba; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.hexEncode = function(){ | |
var hex, i; | |
var result = ""; | |
for (i=0; i<this.length; i++) { | |
hex = this.charCodeAt(i).toString(16); | |
result += ("000"+hex).slice(-4); | |
} | |
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/Turupawn/12cefea88476ce556d01d15705efcd70 | |
/* | |
Try with these iputs in Prover.toml | |
hash_path = ["0x2fbbcae1f6072bd17986e7d705a1a92a634d698f94620b8c5170c470be747d0b", "0x244156862f17c9aa11c1d39da925e4d9e03505e3836804c6774f0a4049ec6eac"] | |
index = "0" | |
priv_key = "1" | |
proposalId = "0" | |
root = "0x02b54b6daa0b81c12a9d75f44d39e52dcbfa2ef2ab04dbe9159559a547a9ae82" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/Turupawn/6a4391fb54d09aae7a091ad2478c1f62#file-zkvoting-sol | |
//SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.19; | |
contract zkVoting is UltraVerifier { | |
struct Proposal { | |
string description; | |
uint deadline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Verification Key Hash: 584edb3633b5589bed16edc896f2c868bc72fe184f3526d873ebd68883df01f7 | |
// SPDX-License-Identifier: Apache-2.0 | |
// Copyright 2022 Aztec | |
pragma solidity >=0.8.4; | |
library UltraVerificationKey { | |
function verificationKeyHash() internal pure returns(bytes32) { | |
return 0x584edb3633b5589bed16edc896f2c868bc72fe184f3526d873ebd68883df01f7; | |
} |
NewerOlder