From f5954630ef4a682842a8bb27aa672e1d0e940456 Mon Sep 17 00:00:00 2001 From: sendra Date: Tue, 6 Aug 2024 11:01:51 +0200 Subject: [PATCH 1/2] fix: Added Readme and license --- LICENSE | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- README.md | 57 +++++++++----------------- 2 files changed, 136 insertions(+), 41 deletions(-) diff --git a/LICENSE b/LICENSE index 07f396a..ac6b13b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,119 @@ -Copyright 2022 BGD Labs +Business Source License 1.1 -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: +License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved. +“Business Source License” is a trademark of MariaDB Corporation Ab. -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. +Parameters + +Licensor: Aave DAO, represented by its governance smart contracts + +Licensed Work: a.DI (Aave Delivery Infrastructure) + The Licensed Work is (c) 2024 Aave DAO, represented by its governance smart contracts + +Additional Use Grant: You are permitted to use, copy, and modify the Licensed Work, subject to + the following conditions: + - Your use of the Licensed Work shall not, directly or indirectly, enable, facilitate, + or assist in any way with the migration of users and/or funds from the Aave ecosystem. + The "Aave ecosystem" is defined in the context of this License as the collection of + software protocols and applications approved by the Aave governance, including all + those produced within compensated service provider engagements with the Aave DAO. + The Aave DAO is able to waive this requirement for one or more third-parties, if and + only if explicitly indicating it on a record 'authorizations' on adi.aavelicense.eth, + controlled by the Aave DAO. + - You are neither an individual nor a direct or indirect participant in any incorporated + organization, DAO, or identifiable group, that has deployed in production any original + or derived software ("fork") of the Aave ecosystem for purposes competitive to Aave, + within the preceding two years. + The Aave DAO is able to waive this requirement for one or more third-parties, if and + only if explicitly indicating it on a record 'authorizations' on adi.aavelicense.eth, + controlled by the Aave DAO. + - You must ensure that the usage of the Licensed Work does not result in any direct or + indirect harm to the Aave ecosystem or the Aave brand. This encompasses, but is not limited to, + reputational damage, omission of proper credit/attribution, or utilization for any malicious + intent. + +Change Date: The earlier of: + - 2027-07-27 + - The date specified in the 'change-date' record on adi.aavelicense.eth, controlled by + the Aave DAO + +Change License: MIT + +----------------------------------------------------------------------------- + +Notice + +The Business Source License (this document, or the “License”) is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. + +----------------------------------------------------------------------------- + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark “Business Source License”, +as long as you comply with the Covenants of Licensor below. + +Covenants of Licensor + +In consideration of the right to use this License’s text and the “Business +Source License” name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where “compatible” means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text “None”. + +3. To specify a Change Date. + +4. Not to modify this License in any other way. diff --git a/README.md b/README.md index cfedd12..05b1144 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,39 @@ -# BGD forge template +# a.DI Deploy -Basic template with prettier and rest configuration +This repository has the scripts necessary to deploy a.DI on all networks supported by Aave. -To create a new project using this template run +It also hosts the necessary scripts and payloads for a.DI maintenance -```shell -$ forge init --template bgd-labs/bgd-forge-template my_new_project -``` +## Deployments -## Recommended modules +[This](/deployments) directory contains the current deployed addresses for the different supported networks. -[bgd-labs/solidity-utils](https://github.com/bgd-labs/solidity-utils) - common contracts we use everywhere, ie transparent proxy and around +## Diffs -[bgd-labs/aave-address-book](https://github.com/bgd-labs/aave-address-book) - the best and only source about all deployed Aave ecosystem related contracts across all the chains +[This](/diffs) directory contains the generated diffs for the different payloads. Comparing current state with the state after payload execution. -[bgd-labs/aave-helpers](https://github.com/bgd-labs/aave-helpers) - useful utils for integration, and not only testing related to Aave ecosystem contracts +## Scripts -[Rari-Capital/solmate](https://github.com/Rari-Capital/solmate) - one of the best sources of base contracts for ERC20, ERC21, which will work with transparent proxy pattern out of the box +[This](scripts) directory contains the necessary scripts to deploy a.DI on a network. It also has the specific scripts to +deploy payloads -[OpenZeppelin/openzeppelin-contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) - another very reputable and well organized source of base contracts for tokens, access control and many others +## Src -## Development +[This](src) directory contains the source code of specific payloads. a.DI code is imported from the [aave-delivery-infrastructure](https://github.com/bgd-labs/aave-delivery-infrastructure) repository. -This project uses [Foundry](https://getfoundry.sh). See the [book](https://book.getfoundry.sh/getting-started/installation.html) for detailed instructions on how to install and use Foundry. -The template ships with sensible default so you can use default `foundry` commands without resorting to `MakeFile`. +Here it can also be found some helper templates to use when creating payloads. For example, to add a new bridge adapter or to update CrossChainController implementation. -### Setup +## Tests -```sh -cp .env.example .env -forge install -``` +[This](tests) directory contains the tests for the payloads. To generate the diffs, inherit from [ADITestBase.sol](/tests/adi/ADITestBase.sol) and call `defaultTest` method. -### Test +## License -```sh -forge test -``` +Copyright © 2024, Aave DAO, represented by its governance smart contracts. -## Advanced features +Created by [BGD Labs](https://bgdlabs.com/). -### Diffing +The default license of this repository is [BUSL1.1](./LICENSE). -For contracts upgrading implementations it's quite important to diff the implementation code to spot potential issues and ensure only the intended changes are included. -Therefore the `Makefile` includes some commands to streamline the diffing process. +**IMPORTANT**. The BUSL1.1 license of this repository allows for any usage of the software, if respecting the *Additional Use Grant* limitations, forbidding any use case damaging anyhow the Aave DAO's interests. -#### Download - -You can `download` the current contract code of a deployed contract via `make download chain=polygon address=0x00`. This will download the contract source for specified address to `src/etherscan/chain_address`. This command works for all chains with a etherscan compatible block explorer. - -#### Git diff - -You can `git-diff` a downloaded contract against your src via `make git-diff before=./etherscan/chain_address after=./src out=filename`. This command will diff the two folders via git patience algorithm and write the output to `diffs/filename.md`. - -**Caveat**: If the onchain implementation was verified using flatten, for generating the diff you need to flatten the new contract via `forge flatten` and supply the flattened file instead fo the whole `./src` folder. From 200d1ff321f160945e4f085409b6a7544f61175f Mon Sep 17 00:00:00 2001 From: sendra Date: Tue, 6 Aug 2024 11:21:46 +0200 Subject: [PATCH 2/2] fix: updated file licenses --- src/templates/BaseADIPayloadUpdate.sol | 2 +- src/templates/BaseAdaptersUpdate.sol | 2 +- src/templates/BaseCCCUpdate.sol | 2 +- src/templates/BaseForwarderAdaptersUpdate.sol | 2 +- src/templates/BaseReceiverAdaptersUpdate.sol | 2 +- src/templates/SimpleAddForwarderAdapter.sol | 2 +- src/templates/SimpleOneToManyAdapterUpdate.sol | 2 +- src/templates/SimpleReceiverAdapterUpdate.sol | 2 +- tests/adi/ADITestBase.sol | 2 +- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/templates/BaseADIPayloadUpdate.sol b/src/templates/BaseADIPayloadUpdate.sol index 7e57d8d..ecca2f1 100644 --- a/src/templates/BaseADIPayloadUpdate.sol +++ b/src/templates/BaseADIPayloadUpdate.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: AGPL-3.0 +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; diff --git a/src/templates/BaseAdaptersUpdate.sol b/src/templates/BaseAdaptersUpdate.sol index a2fd0ff..b3735b5 100644 --- a/src/templates/BaseAdaptersUpdate.sol +++ b/src/templates/BaseAdaptersUpdate.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import './BaseReceiverAdaptersUpdate.sol'; diff --git a/src/templates/BaseCCCUpdate.sol b/src/templates/BaseCCCUpdate.sol index 3529bc6..3198738 100644 --- a/src/templates/BaseCCCUpdate.sol +++ b/src/templates/BaseCCCUpdate.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: AGPL-3.0 +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; diff --git a/src/templates/BaseForwarderAdaptersUpdate.sol b/src/templates/BaseForwarderAdaptersUpdate.sol index a28b12d..2aba9a2 100644 --- a/src/templates/BaseForwarderAdaptersUpdate.sol +++ b/src/templates/BaseForwarderAdaptersUpdate.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {IBaseForwarderAdaptersUpdate, ICrossChainForwarder} from './interfaces/IBaseForwarderAdaptersUpdate.sol'; diff --git a/src/templates/BaseReceiverAdaptersUpdate.sol b/src/templates/BaseReceiverAdaptersUpdate.sol index 1b5ee26..f09af57 100644 --- a/src/templates/BaseReceiverAdaptersUpdate.sol +++ b/src/templates/BaseReceiverAdaptersUpdate.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {IBaseReceiverAdaptersUpdate, ICrossChainReceiver} from './interfaces/IBaseReceiverAdaptersUpdate.sol'; diff --git a/src/templates/SimpleAddForwarderAdapter.sol b/src/templates/SimpleAddForwarderAdapter.sol index 2e3cb5b..8cd518a 100644 --- a/src/templates/SimpleAddForwarderAdapter.sol +++ b/src/templates/SimpleAddForwarderAdapter.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import './BaseAdaptersUpdate.sol'; diff --git a/src/templates/SimpleOneToManyAdapterUpdate.sol b/src/templates/SimpleOneToManyAdapterUpdate.sol index a76db72..18e72f3 100644 --- a/src/templates/SimpleOneToManyAdapterUpdate.sol +++ b/src/templates/SimpleOneToManyAdapterUpdate.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import './BaseAdaptersUpdate.sol'; diff --git a/src/templates/SimpleReceiverAdapterUpdate.sol b/src/templates/SimpleReceiverAdapterUpdate.sol index f876249..1ddb6d0 100644 --- a/src/templates/SimpleReceiverAdapterUpdate.sol +++ b/src/templates/SimpleReceiverAdapterUpdate.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import './BaseAdaptersUpdate.sol'; diff --git a/tests/adi/ADITestBase.sol b/tests/adi/ADITestBase.sol index 3907ff4..1099a2c 100644 --- a/tests/adi/ADITestBase.sol +++ b/tests/adi/ADITestBase.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: AGPL-3.0 +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import 'forge-std/StdJson.sol'; diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index c576fbd..0cd355f 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {Addresses, Ethereum, Polygon, Avalanche, Arbitrum, Optimism, Metis, Binance, Base, Gnosis, Scroll} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol';