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: UNLICENSED | |
pragma solidity 0.7.3; | |
pragma experimental ABIEncoderV2; | |
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; | |
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; | |
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; | |
import "./EthereumParser.sol"; | |
import "./lib/EthUtils.sol"; | |
import "./ethash/ethash.sol"; |
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: GPL-3.0-or-later | |
pragma solidity ^0.8; | |
import "./AdminControlled.sol"; | |
import "./INearBridge.sol"; | |
import "./NearDecoder.sol"; | |
import "./Ed25519.sol"; | |
/// Rizary: it is part of NearBridge interface and deployed on ethereum | |
/// |
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
pragma solidity >= 0.5.0 <0.7.0; | |
import "@aztec/protocol/contracts/ERC1724/ZkAssetMintable.sol"; | |
import "@aztec/protocol/contracts/libs/NoteUtils.sol"; | |
import "@aztec/protocol/contracts/interfaces/IZkAsset.sol"; | |
import "./LoanUtilities.sol"; | |
// Loan is inherit from ZkAssetMintable.sol from AZTEC protocol. | |
// each Loan contract represent a loan in the network. | |
contract Loan is ZkAssetMintable { |
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
// Andika: this is the recursive proof system | |
@proofSystem | |
class RollupProof extends ProofWithInput<RollupStateTransition> { | |
// Andika: first, it has to process the deposit from L1 | |
@branch static processDeposit( | |
pending: MerkleStack<RollupDeposit>, // deposit queue | |
accountDb: AccountDb // L2 account | |
): RollupProof { | |
let before = new RollupState(pending.commitment, accountDb.commitment()); // current L2 state | |
let deposit = pending.pop(); // get deposit from queue |
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
// Deposits ETH or ERC20 tokens onto L2 | |
function deposit( | |
uint[2] memory pubkey, | |
uint amount, | |
uint tokenType | |
) public payable { | |
if ( tokenType == 0 ) { | |
// reserved the token type if sender is same as coordinator | |
require( | |
msg.sender == coordinator, |
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
pub async fn run_core( | |
connection_pool: ConnectionPool, | |
config: &ZkSyncConfig, | |
eth_gateway: EthereumGateway, | |
) -> anyhow::Result<Vec<JoinHandle<()>>> { | |
let (proposed_blocks_sender, proposed_blocks_receiver) = | |
mpsc::channel(DEFAULT_CHANNEL_CAPACITY); | |
let (state_keeper_req_sender, state_keeper_req_receiver) = | |
mpsc::channel(DEFAULT_CHANNEL_CAPACITY); | |
let (eth_watch_req_sender, eth_watch_req_receiver) = mpsc::channel(DEFAULT_CHANNEL_CAPACITY); |
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
package wasm_test | |
import ( | |
// "fmt" | |
// "math" | |
"encoding/json" | |
"syscall/js" | |
"testing" | |
"net/http" |
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
fn visit_while(&mut self, condition: &JasmExpression, body: &Block) -> () { | |
// // we count the length of instruction sequence before adding condition. | |
// let curr_seq_len = self.function_builder.get_mut().func_body().instrs().len(); | |
// self.visit(condition); | |
// // TODO: Find the easiest way to split the wasm sequences. | |
// // |
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
pub fn run_fmt(toml_content: &Root, cwd: PathBuf) -> anyhow::Result<()> { | |
let commands = toml_content | |
.formatters | |
.values() | |
.map(|c| c.command.clone().unwrap_or("".into())); | |
let args = toml_content.formatters.values().map(|c| { | |
let arg = match c.args.clone() { | |
Some(vstr) => vstr, | |
None => Vec::new(), |
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
{ | |
"name": "rust", | |
"version": "0.1.0", | |
"description": "frontend wasm in rust", | |
"license": "MIT", | |
"private": true, | |
"scripts": { | |
"todo_watch": "yarn run todo_clean && rollup -c rollup.dev.js --watch", | |
"todo_clean": "rimraf ./devhtml/js", | |
}, |