Skip to content

Commit

Permalink
build!: re-open LSP16 PR to move it again as its own package (#877)
Browse files Browse the repository at this point in the history
* build!: move LSP17ContractExtension in its own package (#858)

* ci: create deployment script to deploy + verify base contracts on mainnet (#849)

* refactor: convert verify balance script into Hardhat task

* ci: add script to deploy and verify base contracts on mainnet

* ci: create bash file + setup mainnet deployer

* ci: refactor workflow to deploy and verify contracts using Hardhat task

* build!: move LSP17ContractExtension in its own package

* docs: add latest LSP7 + LSP8 Tokens audit report (#861)

* wip

---------

Co-authored-by: Jean Cvllr <[email protected]>
Co-authored-by: CJ42 <[email protected]>

* build!: move lsp16 to its own package

* build: update package-lock.json

* docs: update docs

* test: remove test command of lsp16

* ci: update ci reference for lsp16

* test: add mock contracts

---------

Co-authored-by: Skima Harvey <[email protected]>
Co-authored-by: YamenMerhi <[email protected]>
  • Loading branch information
3 people authored Feb 6, 2024
1 parent a0b18f0 commit a568c28
Show file tree
Hide file tree
Showing 27 changed files with 1,683 additions and 642 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
"lsp20",
"lsp20init",
"lsp23",
"universalfactory",
"reentrancy",
"reentrancyinit",
"mocks",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/solc_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
lsp7/=packages/LSP7DigitalAsset/ \
lsp10/=packages/LSP10ReceivedVaults/ \
lsp14/=packages/LSP14Ownable2Step/ \
lsp16/=packages/LSP16UniversalFactory/ \
lsp17contractextension/=packages/LSP17ContractExtension/ \
lsp20/=packages/LSP20CallVerification/ \
lsp25/=packages/LSP25ExecuteRelayCall/
Expand All @@ -106,6 +107,7 @@ jobs:
lsp7/=packages/LSP7DigitalAsset/ \
lsp10/=packages/LSP10ReceivedVaults/ \
lsp14/=packages/LSP14Ownable2Step/ \
lsp16/=packages/LSP16UniversalFactory/ \
lsp17contractextension/=packages/LSP17ContractExtension/ \
lsp20/=packages/LSP20CallVerification/ \
lsp25/=packages/LSP25ExecuteRelayCall/
Expand Down
435 changes: 0 additions & 435 deletions docs/contracts/LSP16UniversalFactory/LSP16UniversalFactory.md

This file was deleted.

2 changes: 1 addition & 1 deletion dodoc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const dodocConfig = {
'contracts/LSP9Vault/LSP9Vault.sol',
'contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol',
'lsp14/contracts/LSP14Ownable2Step.sol',
'contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol',
'lsp16/contracts/LSP16UniversalFactory.sol',
'lsp17contractextension/contracts/LSP17Extendable.sol',
'lsp17contractextension/contracts/LSP17Extension.sol',
'lsp17/Extension4337.sol',
Expand Down
5 changes: 5 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ out = 'packages/LSP2ERC725YJSONSchema/contracts/foundry_artifacts'
src = 'packages/LSP6KeyManager/contracts'
test = 'packages/LSP6KeyManager/foundry'
out = 'packages/LSP6KeyManager/contracts/foundry_artifacts'

[profile.lsp16]
src = 'packages/LSP16UniversalFactory/contracts'
test = 'packages/LSP16UniversalFactory/foundry'
out = 'packages/LSP16UniversalFactory/contracts/foundry_artifacts'
1 change: 0 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ const config: HardhatUserConfig = {
// Tools
// ------------------
'Create2Factory',
'LSP16UniversalFactory',
'LSP23LinkedContractsFactory',
],
// Whether to include the TypeChain factories or not.
Expand Down
413 changes: 238 additions & 175 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
"test:lsp20init": "hardhat test --no-compile tests/LSP20CallVerification/LSP6/LSP20WithLSP6Init.test.ts",
"test:lsp23": "hardhat test --no-compile tests/LSP23LinkedContractsDeployment/LSP23LinkedContractsDeployment.test.ts",
"test:lsp25": "hardhat test --no-compile tests/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.test.ts",
"test:universalfactory": "hardhat test --no-compile tests/LSP16UniversalFactory/LSP16UniversalFactory.test.ts",
"test:reentrancy": "hardhat test --no-compile tests/Reentrancy/Reentrancy.test.ts",
"test:reentrancyinit": "hardhat test --no-compile tests/Reentrancy/ReentrancyInit.test.ts",
"test:foundry": "forge test --no-match-test Skip -vvv --gas-report > gasreport.ansi",
Expand All @@ -121,6 +120,7 @@
"lsp7": "*",
"lsp10": "*",
"lsp14": "*",
"lsp16": "*",
"lsp17": "*",
"lsp17contractextension": "*",
"lsp20": "*",
Expand Down
4 changes: 4 additions & 0 deletions packages/LSP16UniversalFactory/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['custom'],
};
25 changes: 25 additions & 0 deletions packages/LSP16UniversalFactory/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": "solhint:recommended",
"rules": {
"avoid-sha3": "error",
"avoid-suicide": "error",
"avoid-throw": "error",
"avoid-tx-origin": "error",
"check-send-result": "error",
"compiler-version": ["error", "^0.8.0"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"not-rely-on-block-hash": "error",
"not-rely-on-time": "error",
"reentrancy": "error",
"constructor-syntax": "error",
"private-vars-leading-underscore": ["error", { "strict": false }],
"imports-on-top": "error",
"visibility-modifier-order": "error",
"no-unused-import": "error",
"no-global-import": "error",
"reason-string": ["warn", { "maxLength": 120 }],
"avoid-low-level-calls": "off",
"no-empty-blocks": ["error", { "ignoreConstructors": true }],
"custom-errors": "off"
}
}
3 changes: 3 additions & 0 deletions packages/LSP16UniversalFactory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# LSP16 Universal Factory

Package for the [LSP16-UniversalFactory](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md) standard, contains a contract that allows deploying contracts on multiple chains with the same address.
9 changes: 9 additions & 0 deletions packages/LSP16UniversalFactory/contracts/Mock/Account.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;

import {ERC725} from "@erc725/smart-contracts/contracts/ERC725.sol";

contract Account is ERC725 {
// solhint-disable-next-line no-empty-blocks
constructor(address contractOwner) ERC725(contractOwner) {}
}
13 changes: 13 additions & 0 deletions packages/LSP16UniversalFactory/contracts/Mock/AccountInit.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;

import {
ERC725InitAbstract
} from "@erc725/smart-contracts/contracts/ERC725InitAbstract.sol";

// solhint-disable-next-line no-empty-blocks
contract AccountInit is ERC725InitAbstract {
function initialize(address newOwner) public virtual initializer {
ERC725InitAbstract._initialize(newOwner);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

contract ContractNoConstructor {
uint256 private _number = 5;

function getNumber() public view returns (uint256) {
return _number;
}

function setNumber(uint256 newNumber) public {
_number = newNumber;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

/**
* @dev sample contract used for testing
*/
contract FallbackInitializer {
address public caller;

receive() external payable {
_initialize();
}

fallback() external payable {
_initialize();
}

function _initialize() internal {
caller = msg.sender;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

import {
Initializable
} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract ImplementationTester is Initializable {
address private _owner;

function initialize(address newOwner) public virtual initializer {
_owner = newOwner;
}

function owner() public view virtual returns (address) {
return _owner;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.13;

contract NonPayableContract {
address private _owner;

constructor(address newOwner) {
_owner = newOwner;
}

function getOwner() public view returns (address) {
return _owner;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

contract NonPayableFallback {
// solhint-disable-next-line payable-fallback
fallback() external {}
}
16 changes: 16 additions & 0 deletions packages/LSP16UniversalFactory/contracts/Mock/PayableContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

/**
* @dev sample contract used for testing
*/
contract PayableContract {
// solhint-disable no-empty-blocks
constructor() payable {}

// solhint-disable no-empty-blocks
function payableTrue() public payable {}

// solhint-disable no-empty-blocks
function payableFalse() public {}
}
File renamed without changes.
Loading

0 comments on commit a568c28

Please sign in to comment.