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
/** | |
* @dev Mint DUSD | |
* @param in_amounts Exact in_amounts in the same order as required by the curve pool | |
* @param min_dusd_amount Minimum DUSD to mint, used for capping slippage | |
*/ | |
function mint( | |
uint[] calldata in_amounts, | |
uint min_dusd_amount | |
) external returns (uint dusd_amount) { | |
- pull in_amounts |
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.5.12; | |
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import "./curve/ICurve.sol"; | |
import {DUSD} from "./DUSD.sol"; | |
contract Core { | |
uint constant MAX = 2 ** 256 - 1; | |
uint constant N_COINS = 4; // sUSD pool |
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
/* Add maticjs Library as a dep in your project | |
This library is still WIP, so locking the lib on a commit id for now | |
npm i --save atvanguard/matic.js#ff738ac9addca5ead3474f238f42b921ebfe2ffd | |
*/ | |
import Matic from 'maticjs' | |
async function initializeMaticClient(contracts) { | |
const options = { |
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
[ Result { | |
open: false, | |
executed: false, | |
startDate: '1548287965', | |
snapshotBlock: '7116241', | |
supportRequired: '500000000000000000', | |
minAcceptQuorum: '0', | |
yea: '3014943555192266542494264', | |
nay: '89990168634229999999839', | |
votingPower: '39609523809523809540000000', |
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
d8f608c51fbdd8bc53ffdf557021c33c46c3c9910ac392e5fdca1c7c3fec109688bf3ead77e10c6c35081d2c5ea5aa8cc5a4b42358068fcda72d2f39fdf164af |
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.5.10; | |
import { IMarket } from "./augur/reporting/IMarket.sol"; | |
import { IAccountManager } from "./IAccountManager.sol"; | |
contract AccountManager is IAccountManager { | |
struct Balance { | |
uint256 priority; | |
uint256 balance; |
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
[parity] | |
chain = "spec.json" | |
base_path = "/tmp/parity" | |
keys_path = "./keys" | |
db_path = "./info/chains" | |
[network] | |
port = 30301 | |
reserved_only = false | |
reserved_peers = "./enodes.txt" | |
[rpc] |
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
{ | |
"name": "Matic", | |
"engine": { | |
"authorityRound": { | |
"params": { | |
"stepDuration": "5", | |
"validators": { | |
"list": ["0x9fB29AAc15b9A4B7F17c3385939b007540f4d791"] | |
} | |
} |
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
const crypto = require('crypto'); | |
const BN = require('bn.js'); | |
function getSecretZokratesParams(concat) { | |
return [concat.slice(0, 32), concat.slice(32, 64), concat.slice(64, 96), concat.slice(96)]//.map(e => e.toString(10)) | |
} | |
function getPublicZokratesParams(hexPayload) { | |
// console.log('getPublicZokratesParams - hexPayload', hexPayload) | |
const buf = Buffer.from(hexPayload, 'hex'); |
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 "LIBSNARK/sha256packed" | |
// https://zokrates.github.io/sha256example.html#computing-a-hash-using-zokrates | |
// A field value can only hold 254 bits due to the size of the underlying prime field used by zokrates. Therefore, 256 bit values need to be passed as 2 params of 128 bit values. | |
// https://zokrates.github.io/concepts/stdlib.html?highlight=sha256#sha256packed | |
// At the time of writing sha256packed takes 4 field elements as inputs, unpacks each of them to 128 bits (big endian), concatenates them and applies sha256. It then returns two field elements, each representing 128 bits of the result. | |
// Public inputs | |
// onh0 + onh1: Hash of the note (secret note) |
NewerOlder