This file contains hidden or 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 createAlchemyWeb3 from "@alch/alchemy-web3" | |
import dotenv from "dotenv" | |
dotenv.config(); | |
const BRIDGE_CONTRACT_ADDRESS = "0xe5E30E7c24e4dFcb281A682562E53154C15D3332" | |
const MY_WALLET_ADDRESS = "0x707e55a12557E89915D121932F83dEeEf09E5d70" | |
var web3 = null | |
var bridgeContract = null |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.19; | |
contract CommitReveal | |
{ | |
bytes32 public commitedValue; | |
uint public secretValue; | |
function hashValue(uint _secretValue) public pure returns(bytes32) | |
{ |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.19; | |
contract MutiCommitReveal | |
{ | |
enum CommitmentState {NotCommited, Commited, Revealed} | |
bytes32 public randomness; | |
uint public commitmentDeadline; | |
uint public revealDeadline; |
This file contains hidden or 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
//SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.19; | |
contract zkVoting is UltraVerifier { | |
struct Proposal { | |
string description; | |
uint deadline; | |
uint forVotes; | |
uint againstVotes; |
This file contains hidden or 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
use dep::std; | |
fn main(root : pub Field, index : Field, hash_path : [Field; 2], secret: Field, priv_key: Field, proposalId: pub Field, vote: pub Field) -> pub Field { | |
constrain index == index; | |
let pubkey = std::scalar_mul::fixed_base(priv_key); | |
let pubkey_x = pubkey[0]; | |
let pubkey_y = pubkey[1]; | |
let note_commitment = std::hash::pedersen([pubkey_x, pubkey_y, secret]); |
This file contains hidden or 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
//SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.19; | |
contract zkVoting is UltraVerifier { | |
struct Proposal { | |
string description; | |
uint deadline; | |
uint forVotes; | |
uint againstVotes; |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.20; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@scroll-tech/contracts/libraries/token/IScrollStandardERC20.sol"; | |
contract L2Token is ERC20, IScrollStandardERC20 { | |
// We store the gateway and the L1 token address to provide the gateway() and counterpart() functions which are needed from the Scroll Standard ERC20 interface | |
address _gateway; |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.19; | |
interface IERC165 { | |
/** | |
* @dev Returns true if this contract implements the interface defined by | |
* `interfaceId`. See the corresponding | |
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] | |
* to learn more about how these ids are created. | |
* |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.19; | |
interface IERC165 { | |
/** | |
* @dev Returns true if this contract implements the interface defined by | |
* `interfaceId`. See the corresponding | |
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] | |
* to learn more about how these ids are created. | |
* |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.19; | |
interface IERC165 { | |
/** | |
* @dev Returns true if this contract implements the interface defined by | |
* `interfaceId`. See the corresponding | |
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] | |
* to learn more about how these ids are created. | |
* |