Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
👨🏻‍🍲 Thinking lowkey pizza

Ross Campbell Ro5s

💭
👨🏻‍🍲 Thinking lowkey pizza
View GitHub Profile
@Ro5s
Ro5s / LexLockerV2.sol
Created Sep 25, 2021
Bilateral escrow for ETH and ERC-20/721 tokens.
View LexLockerV2.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0 <0.9.0;
/// @notice Bilateral escrow for ETH and ERC-20/721 tokens.
/// @author LexDAO LLC.
contract LexLocker {
uint256 lockerCount;
mapping(uint256 => Locker) public lockers;
mapping(address => Resolver) public resolvers;
View gist:c0f1d2641d341ad30a0c9fd6a252100c
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0 <0.9.0;
/// @notice Bilateral escrow for ETH and ERC-20/721 tokens.
/// @author LexDAO LLC.
contract LexLocker {
uint256 lockerCount;
mapping(uint256 => Locker) public lockers;
mapping(address => Resolver) public resolvers;
@Ro5s
Ro5s / Mochi.sol
Created Sep 21, 2021
Moloch on BentoBox
View Mochi.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
/*
███ ███ ██████ ██████ ██ ██ ██
████ ████ ██ ██ ██ ██ ██ ██
██ ████ ██ ██ ██ ██ ███████ ██
██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██████ ██████ ██ ██ ██
View gist:00ece5edb64feeffb5345400ad0b1118
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.7;
/*
d888888b d888888b
d888 8888b d888888 888b
d88 88 898888b d8888 888 88b
d8P 88888888b d88888888888 b8b
88 8888888888 88888888888 88
88 88888888888 8888888888 88
View ScotusNames.sol
/**
*Submitted for verification at Etherscan.io on 2021-09-05
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
// SPDX-License-Identifier: MIT
View ERC721Mock.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";
/**
* @title ERC721Mock
* This mock just provides a public safeMint, mint, and burn functions for testing purposes
*/
@Ro5s
Ro5s / RestrictedTokenFactory.sol
Created Sep 3, 2021
permissioned factory for erc20 tokens with an admin set on construction
View RestrictedTokenFactory.sol
/// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
/// @notice Basic ERC20 implementation.
contract Token {
string public name;
string public symbol;
uint8 constant public decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
@Ro5s
Ro5s / useCreamToBentoStrategy.ts
Created Aug 1, 2021
stake cToken xsushi into bento xsushi shares
View useCreamToBentoStrategy.ts
import { t } from '@lingui/macro'
import { CRXSUSHI, XSUSHI } from '../../../constants'
import { ChainId, SUSHI_ADDRESS } from '@sushiswap/sdk'
import { tryParseAmount } from '../../../functions'
import { useBentoBalance } from '../../bentobox/hooks'
import { useActiveWeb3React } from '../../../hooks'
import { useTokenBalances } from '../../wallet/hooks'
import { StrategyGeneralInfo, StrategyHook, StrategyTokenDefinitions } from '../types'
import useBaseInariStrategy from './useBaseInariStrategy'
import { useEffect, useMemo } from 'react'
@Ro5s
Ro5s / useAaveToBentoStrategy.ts
Created Aug 1, 2021
stake xsushi atoken into xsushi bento shares
View useAaveToBentoStrategy.ts
import { t } from '@lingui/macro'
import { AXSUSHI, XSUSHI } from '../../../constants'
import { ChainId, SUSHI_ADDRESS } from '@sushiswap/sdk'
import { tryParseAmount } from '../../../functions'
import { useBentoBalance } from '../../bentobox/hooks'
import { useActiveWeb3React } from '../../../hooks'
import { useTokenBalances } from '../../wallet/hooks'
import { StrategyGeneralInfo, StrategyHook, StrategyTokenDefinitions } from '../types'
import useBaseInariStrategy from './useBaseInariStrategy'
import { useEffect, useMemo } from 'react'
@Ro5s
Ro5s / BentoShareTest.sol
Created Jul 24, 2021
BentoShareTest.sol
View BentoShareTest.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.2;
interface IFlashBorrower {
/// @notice The flashloan callback. `amount` + `fee` needs to repayed to msg.sender before this call returns.
/// @param sender The address of the invoker of this flashloan.
/// @param token The address of the token that is loaned.
/// @param amount of the `token` that is loaned.
/// @param fee The fee that needs to be paid on top for this loan. Needs to be the same as `token`.