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.0; | |
contract CompileVsRuntime { | |
uint256 public constant j0 = ((7 / 11 + 3 / 13) * 22 + 1) * 39; | |
function foo(uint256 x, uint256 y, uint256 w, uint256 z, uint256 x2, uint256 y2, uint256 w2) external pure returns (uint256) { | |
uint256 j1 = ((x / y + z / w) * x2 + y2) * w2; | |
return j1; | |
} |
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.0; | |
contract Mulmod { | |
uint256 public constant a = 2**254; | |
uint256 public constant b = 2**255; | |
function doMul(uint256 x, uint256 y) external pure returns (uint256) { | |
return x * y; |
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
//! Liquidator Module | |
//! | |
//! This module is responsible for triggering liquidations. | |
use crate::{escalator::GeometricGasPrice, vault::Vault, HifiResult}; | |
use ethers::{ | |
core::abi::{self, Tokenize}, | |
prelude::*, | |
}; | |
use hifi_liquidator_bindings::{FyToken, UniswapV2Pair}; |
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
const ethers = require("ethers"); | |
const DSProxyAbi = require("../abis/DSProxy.json"); | |
const TargetContractAbi = require("../abis/TargetContract.json"); | |
const defaultProvider = ethers.getDefaultProvider("kovan"); | |
const dsProxyAddress = "0xa92Bed719071A4d33B0B348513E7e866a6ff6B3F"; | |
const dsProxy = new ethers.Contract(dsProxyAddress, DSProxyAbi, defaultProvider); | |
const targetContractAddress = "0xE3CD2e7a628b57d3e50c5f7B921182f676721bDF"; | |
const targetContract = new ethers.Contract(targetContractAddress, TargetContractAbi, defaultProvider); |
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
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
✅ did:3:bafyreibj65scex56egywsjogkoymcirx4epjlrpwlzmwuqbkgy3toyxe6y ✅ | |
Create your profile today to start building social connection and trust online at https://3Box.io/ |
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
Compiling... | |
Compiled 2 contracts successfully | |
Creating TypeChain artifacts in directory typechain for target ethers-v5 | |
An unexpected error occurred: | |
SyntaxError: '=' expected. (8:15) | |
6 | import { Contract, ContractFactory, Overrides } from "@ethersproject/contracts"; | |
7 | | |
> 8 | import type { Greeter } from "./Greeter"; | |
| ^ |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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: LGPL-3.0-or-later */ | |
pragma solidity ^0.6.10; | |
/** | |
* @title CarefulMath | |
* @author Compound | |
* @notice Exponential module for storing fixed-precision decimals. | |
* @dev Derived from OpenZeppelin's SafeMath library | |
*/ | |
abstract contract CarefulMath { |
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 { BigNumber } from "@ethersproject/bignumber"; | |
import { Signer } from "@ethersproject/abstract-signer"; | |
import { waffle } from "@nomiclabs/buidler"; | |
import { expect } from "chai"; | |
export function shouldBehaveLikeGreeter(_signers: Signer[]): void { | |
describe("1st Block", function () { | |
beforeEach(async function () { | |
await waffle.provider.send("evm_setNextBlockTimestamp", [1597348800]); | |
const blockTimestamp: BigNumber = await this.testotron.getBlockTimestamp(); |
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 { Erc20 } from "../typechain/Erc20"; | |
declare module "mocha" { | |
export interface Context { | |
token: Token; | |
} | |
} |