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.8.0; | |
interface CurveContract { | |
function calc_withdraw_one_coin(uint256 token_amount, uint256 i) external view returns(uint256); | |
} |
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.8.0; | |
interface CoreVoting { | |
enum Ballot { | |
YES, | |
NO, | |
MAYBE | |
} | |
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 { Vault__factory } from "typechain/factories/Vault__factory"; | |
import { ethers } from "hardhat"; | |
import * as readline from "readline-sync"; | |
const BALANCER_VAULT_ADDRESS = ""; | |
const PT_POOL_ADDRESS = ""; | |
const PT_ADDRESS = ""; | |
const UNDERLYING_ADDRESS = ""; | |
const UNDERLYING_DECIMALS = 18; |
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
// Uses a default infinite expiration time | |
async function getPermitSignature( | |
token: ERC20Permit, | |
sourceAddr: string, | |
spenderAddr: string, | |
spenderAmount: BigNumberish, | |
version: string | |
) { | |
// To be replaced in front end with signer type from ethers |
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
function americanPut(T, S, K, r, sigma, q, n) | |
{ | |
' T... expiration time | |
' S... stock price | |
' K... strike price | |
' q... dividend yield | |
' n... height of the binomial tree | |
deltaT := T / n; | |
up := exp(sigma * sqrt(deltaT)); | |
p0 := (up*exp(-q * deltaT) - exp(-r * deltaT)) / (up^2 - 1); |
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
use zkp_stark::{*, primefield::*}; | |
#[derive(Clone, Debug)] | |
struct Claim { | |
index: usize, | |
value: FieldElement, | |
} | |
#[derive(Clone, Debug)] | |
struct Witness { |
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
Compiling substrate-node v1.0.0 (/Users/pvienhage/dev/starkcrypto/substrate-node) | |
Compiling substrate-runtime v1.0.0 (/Users/pvienhage/dev/starkcrypto/substrate-runtime) | |
error[E0412]: cannot find type `Event` in this scope | |
--> substrate-runtime/src/exchange.rs:50:1 | |
| | |
50 | / decl_module! { | |
51 | | /// The module declaration. | |
52 | | pub struct Module<T: Trait> for enum Call where origin: T::Origin { | |
53 | | // Initializing events | |
... | |
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.24; | |
import "./IERC721.sol"; | |
import "./IERC721Receiver.sol"; | |
import "../../math/SafeMath.sol"; | |
import "../../utils/Address.sol"; | |
import "../../introspection/ERC165.sol"; | |
/** | |
* @title ERC721 Non-Fungible Token Standard basic implementation |
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.24; | |
import "./IERC721.sol"; | |
import "./IERC721Receiver.sol"; | |
import "../../math/SafeMath.sol"; | |
import "../../utils/Address.sol"; | |
import "../../introspection/ERC165.sol"; | |
/** | |
* @title ERC721 Non-Fungible Token Standard basic implementation with added support for metatransactions |
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
// Partially derived from code by Lionello Lunesu | |
pragma solidity ^0.5.2; | |
contract ModExp { | |
// address constant MODEXP_BUILTIN = 0x0000000000000000000000000000000000000005; | |
function modexp(uint256 b, uint256 e, uint256 m) internal returns(uint256 result) { |
NewerOlder