Skip to content

Commit

Permalink
chore: licensing and copyright notices (#49)
Browse files Browse the repository at this point in the history
* chore: all Solidity MIT licensed

* chore: copyright and author notices

* chore: `LICENSE` and `NOTICE` files

* chore: new line at end of `NOTICE`

* chore: add missing `@author`

* chore: fix copyright notice on general-purpose file
  • Loading branch information
ARR4N authored Oct 29, 2024
1 parent ae13269 commit ba00bbb
Show file tree
Hide file tree
Showing 30 changed files with 76 additions and 36 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[See NOTICE file for copyright notice]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 8 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
While all code is made available under the MIT License, the required copyright
notice differs for some Solidity files. Unless a file states differently, the
default notice is:

Copyright 2024 Divergence Tech Ltd.

Any file with a different copyright owner has its notice stated explicitly,
immediately after the SPDX identifier.
2 changes: 1 addition & 1 deletion src/ConsiderationLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

Expand Down
3 changes: 2 additions & 1 deletion src/ERC721ForERC20/ERC721ForERC20Swap.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {ERC20Consideration} from "../ConsiderationLib.sol";
Expand Down
3 changes: 2 additions & 1 deletion src/ERC721ForNative/ERC721ForNativeSwap.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {Consideration} from "../ConsiderationLib.sol";
Expand Down
3 changes: 2 additions & 1 deletion src/ERC721TransferLib.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

Expand All @@ -10,6 +10,7 @@ import {Parties} from "./TypesAndConstants.sol";
* @dev Note that all `_transfer(<T>, Parties)` functions have effectively the same signature, allowing them to be
* called without explicit knowledge of the <T> type as the constructor will select the respective function. This is
* exploited by the `TMPL/SwapperBase.sol.tmpl` template.
* @author Arran Schlosberg (@divergencearran / github.com/arr4n)
*/
library ERC721TransferLib {
/// @dev Thrown if a token address doesn't contain any code.
Expand Down
3 changes: 2 additions & 1 deletion src/MultiERC721ForERC20/MultiERC721ForERC20Swap.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {ERC20Consideration} from "../ConsiderationLib.sol";
Expand Down
3 changes: 2 additions & 1 deletion src/MultiERC721ForNative/MultiERC721ForNativeSwap.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {Consideration} from "../ConsiderationLib.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/SWAP2.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {
Expand Down
5 changes: 3 additions & 2 deletions src/SwapperBase.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {Parties, PayableParties} from "./TypesAndConstants.sol";
Expand All @@ -8,6 +8,7 @@ import {Parties, PayableParties} from "./TypesAndConstants.sol";
* @dev Base contract for all <T>Swapper implementations. As implementations are created by simple text substitution
* from templates, they require function overloading based on <T>Swap struct fields; this contract enables such
* behaviour, greatly simplifying code generation.
* @author Arran Schlosberg (@divergencearran / github.com/arr4n)
*/
contract SwapperBase {
/// @dev Converts a `PayableParties` struct into a `Parties`, using the same backing memory.
Expand Down
4 changes: 2 additions & 2 deletions src/SwapperDeployerBase.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {IEscrow} from "./Escrow.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/SwapperProposerBase.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

/// @dev Abstract base contract for all <T>SwapperProposer implementations.
Expand Down
5 changes: 3 additions & 2 deletions src/TMPL/ForERC20Swapper.tmpl.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;
/**
* GENERATED CODE - DO NOT EDIT
Expand All @@ -9,6 +9,7 @@ import {TMPLSwap} from "./TMPLSwap.sol";
import {TMPLSwapperBase} from "./TMPLSwapperBase.tmpl.sol";

/// @notice Executes the TMPLSwap received in the constructor.
/// @author Arran Schlosberg (@divergencearran / github.com/arr4n)
contract TMPLSwapper is TMPLSwapperBase {
constructor(TMPLSwap memory swap, uint256 currentChainId) TMPLSwapperBase(swap, currentChainId) {}
}
5 changes: 3 additions & 2 deletions src/TMPL/ForNativeSwapper.tmpl.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;
/**
* GENERATED CODE - DO NOT EDIT
Expand All @@ -9,6 +9,7 @@ import {TMPLSwap} from "./TMPLSwap.sol";
import {TMPLSwapperBase} from "./TMPLSwapperBase.tmpl.sol";

/// @notice Executes the TMPLSwap received in the constructor.
/// @author Arran Schlosberg (@divergencearran / github.com/arr4n)
contract TMPLSwapper is TMPLSwapperBase {
constructor(TMPLSwap memory swap, uint256 currentChainId) payable TMPLSwapperBase(swap, currentChainId) {}
}
3 changes: 2 additions & 1 deletion src/TMPL/TMPLSwap.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;

import {ERC20Consideration} from "../ConsiderationLib.sol";
Expand Down
5 changes: 3 additions & 2 deletions src/TMPL/TMPLSwapperBase.tmpl.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;
/**
* GENERATED CODE - DO NOT EDIT
Expand Down Expand Up @@ -27,6 +27,7 @@ import {
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";

/// @dev Base contract for a TMPLSwapper implementation.
/// @author Arran Schlosberg (@divergencearran / github.com/arr4n)
contract TMPLSwapperBase is SwapperBase {
using ActionMessageLib for Message;
using ConsiderationLib for *;
Expand Down
7 changes: 5 additions & 2 deletions src/TMPL/TMPLSwapperDeployer.tmpl.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// Copyright 2024 Divergence Tech Ltd.
// SPDX-License-Identifier: MIT
// Copyright 2024 Lomita Digital, Inc.
pragma solidity 0.8.25;
/**
* GENERATED CODE - DO NOT EDIT
Expand All @@ -14,6 +14,7 @@ import {SwapperProposerBase} from "../SwapperProposerBase.sol";
import {OnlyPartyCanCancel, ActionMessageLib, CANCEL_MSG, ISwapperEvents} from "../TypesAndConstants.sol";

/// @dev Predictor of TMPLSwapper contract addresses.
/// @author Arran Schlosberg (@divergencearran / github.com/arr4n)
contract TMPLSwapperPredictor {
function _swapper(TMPLSwap calldata swap, bytes32 salt, address deployer, uint256 chainId)
internal
Expand All @@ -29,6 +30,7 @@ contract TMPLSwapperPredictor {
}

/// @dev Deployer of TMPLSwapper contracts.
/// @author Arran Schlosberg (@divergencearran / github.com/arr4n)
abstract contract TMPLSwapperDeployer is TMPLSwapperPredictor, ETDeployer, SwapperDeployerBase, ISwapperEvents {
/// @dev Execute the `TMPLSwap`, transferring all assets between the parties.
function fillTMPL(TMPLSwap calldata swap, bytes32 salt) external payable returns (address) {
Expand Down Expand Up @@ -66,6 +68,7 @@ interface ITMPLSwapperProposerEvents {
event TMPLProposal(address indexed swapper, address indexed seller, address indexed buyer, TMPLSwap, bytes32 salt);
}

/// @author Arran Schlosberg (@divergencearran / github.com/arr4n)
abstract contract TMPLSwapperProposer is TMPLSwapperPredictor, ITMPLSwapperProposerEvents, SwapperProposerBase {
/**
* @notice "Announces" a propsed swap (in the form of a `Proposal` event), using the last block's hash as the salt
Expand Down
2 changes: 1 addition & 1 deletion src/TypesAndConstants.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

Expand Down
3 changes: 2 additions & 1 deletion test/ERC20Test.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {SwapperTestBase, SwapperTestLib} from "./SwapperTestBase.t.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/ERC721ForERC20.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/ERC721ForNative.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/ERC721ForXTest.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test, Vm} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/ERC721TransferLib.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/Escrow.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/MultiERC721ForERC20.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/MultiERC721ForNative.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/NativeTokenTest.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {SwapperTestBase, SwapperTestLib} from "./SwapperTestBase.t.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/Owner.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/SwapperTestBase.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down
3 changes: 2 additions & 1 deletion test/TypesAndConstants.t.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
// SPDX-License-Identifier: MIT
// Copyright 2024 Divergence Tech Ltd.
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";
Expand Down

0 comments on commit ba00bbb

Please sign in to comment.