-
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.
- Loading branch information
Showing
20 changed files
with
246 additions
and
593 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
/** | ||
* @dev sample contract used for testing | ||
*/ | ||
contract FallbackContract { | ||
fallback() external payable {} | ||
} |
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,11 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
/** | ||
* @dev This contract is used only for testing purposes | ||
*/ | ||
contract AgeExtension { | ||
function age() public view virtual returns (uint256) { | ||
return 20; | ||
} | ||
} |
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,11 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
/** | ||
* @dev This contract is used only for testing purposes | ||
*/ | ||
contract NameExtension { | ||
function name() public view virtual returns (string memory) { | ||
return "LUKSO"; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.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,30 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
/** | ||
* @title sample contract used for testing | ||
*/ | ||
contract BothCallReturnSuccessValue { | ||
function lsp20VerifyCall( | ||
address /* requestor */, | ||
address /* targetContract */, | ||
address /* caller */, | ||
uint256 /* value */, | ||
bytes memory /* data */ | ||
) external pure returns (bytes4 magicValue) { | ||
return | ||
bytes4( | ||
abi.encodePacked( | ||
bytes3(BothCallReturnSuccessValue.lsp20VerifyCall.selector), | ||
hex"01" | ||
) | ||
); | ||
} | ||
|
||
function lsp20VerifyCallResult( | ||
bytes32 /*callHash*/, | ||
bytes memory /*result*/ | ||
) external pure returns (bytes4) { | ||
return BothCallReturnSuccessValue.lsp20VerifyCallResult.selector; | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.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,35 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
/** | ||
* @title sample contract used for testing | ||
*/ | ||
contract FirstCallReturnSuccessValue { | ||
function lsp20VerifyCall( | ||
address /* requestor */, | ||
address /* targetContract */, | ||
address /* caller */, | ||
uint256 /* value */, | ||
bytes memory /* data */ | ||
) external pure returns (bytes4 magicValue) { | ||
return | ||
bytes4( | ||
abi.encodePacked( | ||
bytes3( | ||
FirstCallReturnSuccessValue.lsp20VerifyCall.selector | ||
), | ||
hex"00" | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* @dev should not be called | ||
*/ | ||
function lsp20VerifyCallResult( | ||
bytes32 /*callHash*/, | ||
bytes memory /*result*/ | ||
) external pure returns (bytes4) { | ||
revert("This revert will not be triggered"); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.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,43 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
/** | ||
* @title sample contract used for testing | ||
*/ | ||
contract SecondCallReturnExpandedSuccessValue { | ||
function lsp20VerifyCall( | ||
address /* requestor */, | ||
address /* targetContract */, | ||
address /* caller */, | ||
uint256 /* value */, | ||
bytes memory /* data */ | ||
) external pure returns (bytes4 magicValue) { | ||
return | ||
bytes4( | ||
abi.encodePacked( | ||
bytes3( | ||
SecondCallReturnExpandedSuccessValue | ||
.lsp20VerifyCall | ||
.selector | ||
), | ||
hex"01" | ||
) | ||
); | ||
} | ||
|
||
function lsp20VerifyCallResult( | ||
bytes32 /*callHash*/, | ||
bytes memory /*result*/ | ||
) external pure returns (bytes32) { | ||
return | ||
bytes32( | ||
bytes.concat( | ||
bytes4( | ||
SecondCallReturnExpandedSuccessValue | ||
.lsp20VerifyCallResult | ||
.selector | ||
) | ||
) | ||
); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.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,32 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.4; | ||
|
||
/** | ||
* @title sample contract used for testing | ||
*/ | ||
contract SecondCallReturnFailureValue { | ||
function lsp20VerifyCall( | ||
address /* requestor */, | ||
address /* targetContract */, | ||
address /* caller */, | ||
uint256 /* value */, | ||
bytes memory /* data */ | ||
) external pure returns (bytes4 magicValue) { | ||
return | ||
bytes4( | ||
abi.encodePacked( | ||
bytes3( | ||
SecondCallReturnFailureValue.lsp20VerifyCall.selector | ||
), | ||
hex"01" | ||
) | ||
); | ||
} | ||
|
||
function lsp20VerifyCallResult( | ||
bytes32 /*callHash*/, | ||
bytes memory /*result*/ | ||
) external pure returns (bytes4) { | ||
return bytes4(0); | ||
} | ||
} |
Oops, something went wrong.