Skip to content

Instantly share code, notes, and snippets.

View lucas-manuel's full-sized avatar

Lucas Manuel lucas-manuel

View GitHub Profile
coverage_report:
name: Generate coverage report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly
@lucas-manuel
lucas-manuel / style-guide.md
Created June 11, 2022 14:05
Solidity Style Guide

Top of File

All files should have a license and pragma defined in the top two lines of the file:

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.6.11;

Contract Imports

  1. All imports must be explicit, importing only what is necessary from each file.
@lucas-manuel
lucas-manuel / xMPL.sol
Created May 24, 2022 15:26
Flattened xMPL
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;
/// @title Interface of the ERC20 standard as defined in the EIP, including EIP-2612 permit functionality.
interface IERC20 {
/**************/
/*** Events ***/
/**************/
@lucas-manuel
lucas-manuel / repo-rinse.sh
Created December 15, 2021 18:25 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive

Install hevm

Had to do a brew install cabal-install in order to get the cabal install --lib command to work

Had to do a brew install libtool for ./autogen.sh in secp256k1

Need to do brew install openssl

Had to add

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.7;
import { IMapleProxyFactory } from "../modules/maple-proxy-factory/contracts/interfaces/IMapleProxyFactory.sol";
import { IMapleBorrower } from "./interfaces/IMapleBorrower.sol";
import { MapleBorrowerInternals } from "./MapleBorrowerInternals.sol";
/// @title MapleBorrower facilitates atomic and batch borrower functionality for MapleLoans.
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.7;
import { MapleBorrowerInternals } from "./MapleBorrowerInternals.sol";
/// @title MapleBorrowerInitializer is intended to initialize the storage of a MapleBorrower proxy.
contract MapleBorrowerInitializer is MapleBorrowerInternals {
function encodeArguments(address owner_) external pure returns (bytes memory encodedArguments_) {
return abi.encode(owner_);
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.7;
import { ERC20Helper } from "../modules/erc20-helper/src/ERC20Helper.sol";
import { MapleProxied } from "../modules/maple-proxy-factory/contracts/MapleProxied.sol";
import { IMapleLoan } from "./interfaces/IMapleLoan.sol";
contract MapleBorrowerInternals is MapleProxied {
#!/usr/bin/env bash
set -e
export TEST_ADDR=$(dapp create Test)
echo TEST_ADDR $TEST_ADDR
seth send $TEST_ADDR 'test_upgradeability_withNoMigration()'
#!/usr/bin/env bash
set -e
export ETH_GAS=4000000
##########################################################
## Deploy ProxyFactory, InitializerV1, ImplementationV1 ##
##########################################################
echo 'Deploying ProxyFactory'