-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: create mock contracts to move TS tests in LSP16 package
- Loading branch information
Showing
15 changed files
with
10,602 additions
and
2,522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,6 @@ jobs: | |
"lsp20", | ||
"lsp20init", | ||
"lsp23", | ||
"universalfactory", | ||
"reentrancy", | ||
"reentrancyinit", | ||
"mocks", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
packages/LSP16UniversalFactory/contracts/Mocks/AccountInit.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/LSP16UniversalFactory/contracts/Mocks/ContractNoConstructor.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/LSP16UniversalFactory/contracts/Mocks/FallbackInitializer.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
packages/LSP16UniversalFactory/contracts/Mocks/NonPayableContract.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.