-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #261 from CMTA/update-lib
Update lib
- Loading branch information
Showing
18 changed files
with
4,734 additions
and
8,385 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//SPDX-License-Identifier: MPL-2.0 | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "../interfaces/engine/IAuthorizationEngine.sol"; | ||
|
||
/* | ||
@title a mock for testing, not suitable for production | ||
*/ | ||
contract AuthorizationEngineMock is IAuthorizationEngine { | ||
address nextAdmin; | ||
|
||
constructor() { | ||
|
||
} | ||
|
||
/* | ||
* @dev | ||
* Warning: if you want to use this mock, you have to restrict the access to this function through an an access control | ||
*/ | ||
function authorizeAdminChange(address newAdmin) external { | ||
nextAdmin = newAdmin; | ||
} | ||
|
||
/* | ||
* @dev | ||
* Warning: if you want to use this mock, you have to restrict the access to this function through an an access control | ||
*/ | ||
function operateOnAuthorization( | ||
bytes32 role, address account | ||
) external returns (bool isValid){ | ||
if(role == 0x0 && account == nextAdmin && account != address(0x0)){ | ||
// Reset to 0 | ||
nextAdmin = address(0x0); | ||
return true; | ||
}else{ | ||
return false; | ||
} | ||
} | ||
} |
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
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
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
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
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.