Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into develop #683

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Next version

# 2.0.1

- Update licenses:
- Change license of Contants.sol and TickLib.sol from BUSL-1.1 to MIT
- Replace Unlicense, BSD-2-Clause, and AGPL-3.0 with MIT
- Restore MIT license for OpenZeppelin code

# 2.0.0

- New tick-based API with constant-gas insert, update, and retract of offers (the volume-based API is still available)
Expand Down
735 changes: 33 additions & 702 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Debug.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
2 changes: 1 addition & 1 deletion lib/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

interface IERC20 {
Expand Down
2 changes: 1 addition & 1 deletion lib/Script2.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-2.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Script} from "@mgv/forge-std/Script.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/Test2.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Test, console2} from "@mgv/forge-std/Test.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/ToyENS.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

/* Onchain contract registry with the following features:
Expand Down
2 changes: 1 addition & 1 deletion lib/TransferLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BSD-2-Clause
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "@mgv/src/core/MgvLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/core/Constants.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/* The constants below are written as literals to optimize gas. For all the relevant constants here, the non-literal expression that computes them is checked in `Constants.t.sol`. */
Expand Down
2 changes: 1 addition & 1 deletion lib/core/LocalExtra.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {Bin,TickTreeLib,Field} from "@mgv/lib/core/TickTreeLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/core/OfferDetailExtra.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {OfferDetail,OfferDetailUnpacked} from "@mgv/src/preprocessed/OfferDetail.post.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/core/OfferExtra.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@mgv/lib/core/TickTreeLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/core/TickLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {Bin} from "@mgv/lib/core/TickTreeLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion lib/preprocessed/ToString.post.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mangrovedao/mangrove-core",
"version": "2.0.0",
"version": "2.0.1",
"author": "Mangrove DAO",
"license": "SEE LICENSE IN LICENSE",
"main": "index.js",
Expand Down
3 changes: 2 additions & 1 deletion preprocessing/Struct.pre.sol.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
import { format, tabulate } from "./lib/format";

export const template = ({ preamble, struct_utilities, struct: s }) => {
return format`// SPDX-License-Identifier: Unlicense
return format`// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
3 changes: 2 additions & 1 deletion preprocessing/StructTest.pre.sol.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
import { format, tabulate } from "./lib/format";

export const template = ({ preamble, struct_utilities, struct: s }) => {
return format`// SPDX-License-Identifier: AGPL-3.0
return format`// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
3 changes: 2 additions & 1 deletion preprocessing/Structs.pre.sol.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
import { format } from "./lib/format";

export const template = ({ preamble, structs }) => {
return format`// SPDX-License-Identifier: Unlicense
return format`// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
3 changes: 2 additions & 1 deletion preprocessing/ToString.pre.sol.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: MIT
import { format } from "./lib/format";


export const template = ({ preamble, structs }) => {
return format`// SPDX-License-Identifier: Unlicense
return format`// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
2 changes: 2 additions & 0 deletions preprocessing/lib/format.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

// template tag that converts array to separate lines but keeps the current
// indent level
export const format = (strings: TemplateStringsArray, ...nuggets: any[]) => {
Expand Down
1 change: 1 addition & 0 deletions preprocessing/lib/preproc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: MIT
import * as util from "util";

/*
Expand Down
1 change: 1 addition & 0 deletions preprocessing/run.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: MIT
import * as fs from "fs";

import struct_defs from "./structs";
Expand Down
1 change: 1 addition & 0 deletions preprocessing/structs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: MIT
/* # Mangrove Summary
* Mangrove holds offer lists for `outbound_tkn`,`inbound_tkn` pairs with a given `tickSpacing`.
* Offers are sorted in a tree (the "tick tree") where each available price point (a `bin`) holds a doubly linked list of offers.
Expand Down
2 changes: 1 addition & 1 deletion script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This directory contains scripts (`*.s.sol`) for deploying, configuring, and gove
This is a script example:

```solidity
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
// This script is SmallMgvReaderDeployer.s.sol
pragma solidity ^0.8.13;

Expand Down
2 changes: 1 addition & 1 deletion script/core/ActivateMarket.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Deployer} from "@mgv/script/lib/Deployer.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/ActivateSemibook.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Deployer} from "@mgv/script/lib/Deployer.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/DeactivateMarket.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Deployer} from "@mgv/script/lib/Deployer.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/UseOracle.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Deployer} from "@mgv/script/lib/Deployer.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/deployers/ArbitrumMangroveDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {ToyENS} from "@mgv/lib/ToyENS.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/deployers/MangroveDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Mangrove} from "@mgv/src/core/Mangrove.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/deployers/MumbaiMangroveDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {ToyENS} from "@mgv/lib/ToyENS.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/deployers/PolygonMangroveDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {ToyENS} from "@mgv/lib/ToyENS.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/monitors/EvalSnipeOffer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Deployer} from "@mgv/script/lib/Deployer.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/core/monitors/MarketHealth.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Deployer} from "@mgv/script/lib/Deployer.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/lib/Deployer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Script2} from "@mgv/lib/Script2.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/lib/GetTokenDealSlot.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Deployer} from "@mgv/script/lib/Deployer.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/periphery/CopyOpenSemibooks.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@mgv/src/periphery/MgvReader.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/periphery/UpdateMarket.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@mgv/src/periphery/MgvReader.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/periphery/deployers/MgvReaderDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Script, console} from "@mgv/forge-std/Script.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/toy/deployers/ERC20Deployer.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@mgv/src/core/MgvLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/toy/deployers/PixieMATICDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Script, console} from "@mgv/forge-std/Script.sol";
Expand Down
2 changes: 1 addition & 1 deletion script/toy/deployers/PixieUSDCDeployer.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Script, console} from "@mgv/forge-std/Script.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/IMangrove.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
// This file must be kept up-to-date with the actual Mangrove interface.

pragma solidity >=0.7.0 <0.9.0;
Expand Down
2 changes: 1 addition & 1 deletion src/core/MgvLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

/* `MgvLib` contains data structures returned by external calls to Mangrove and the interfaces it uses for its own external calls. */

Expand Down
2 changes: 1 addition & 1 deletion src/preprocessed/Global.post.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
2 changes: 1 addition & 1 deletion src/preprocessed/Local.post.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
2 changes: 1 addition & 1 deletion src/preprocessed/Offer.post.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
2 changes: 1 addition & 1 deletion src/preprocessed/OfferDetail.post.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
2 changes: 1 addition & 1 deletion src/preprocessed/Structs.post.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

Expand Down
3 changes: 2 additions & 1 deletion src/toy/ERC20.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: MIT
// Code adapted from OpenZeppelin Contracts
pragma solidity >=0.8.0;

import {IERC20} from "@mgv/lib/IERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/toy/ERC20BL.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "./ERC20.sol";
Expand Down
3 changes: 2 additions & 1 deletion src/toy/ERC20Lib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: MIT
// Code adapted from OpenZeppelin Contracts
pragma solidity >=0.8.0;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/toy/MintableERC20BLWithDecimals.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "./ERC20BL.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/toy/PixieMATIC.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {MintableERC20BLWithDecimals} from "./MintableERC20BLWithDecimals.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/toy/PixieUSDC.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: Unlicense
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {MintableERC20BLWithDecimals} from "./MintableERC20BLWithDecimals.sol";
Expand Down
2 changes: 1 addition & 1 deletion test-ratios/TickRatioConversion.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

Expand Down
2 changes: 1 addition & 1 deletion test/core/BasicMakerOperations.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

Expand Down
2 changes: 1 addition & 1 deletion test/core/Constants.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

Expand Down
2 changes: 1 addition & 1 deletion test/core/Density.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT

// those tests should be run with -vv so correct gas estimates are shown

Expand Down
2 changes: 1 addition & 1 deletion test/core/DynamicTicks.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

Expand Down
2 changes: 1 addition & 1 deletion test/core/Field.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

Expand Down
2 changes: 1 addition & 1 deletion test/core/Gatekeeping.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.10;

Expand Down
2 changes: 1 addition & 1 deletion test/core/IMangroveAbi.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import {Test2} from "@mgv/lib/Test2.sol";
Expand Down
Loading
Loading