-
Notifications
You must be signed in to change notification settings - Fork 10
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 #15 from lombard-finance/dev
Release BTCBPMM
- Loading branch information
Showing
27 changed files
with
2,353 additions
and
846 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,37 @@ | ||
name: Hardhat Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: [self-hosted] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.17.0" | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Run Hardhat tests | ||
run: yarn hardhat test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts (last updated v5.0.0) (governance/TimelockController.sol) | ||
|
||
pragma solidity 0.8.24; | ||
|
||
interface ITimelockController { | ||
/** | ||
* @dev Returns whether an id corresponds to a registered operation. This | ||
* includes both Waiting, Ready, and Done operations. | ||
*/ | ||
function isOperation(bytes32 id) external view returns (bool); | ||
|
||
/** | ||
* @dev Returns whether an operation is pending or not. Note that a "pending" operation may also be "ready". | ||
*/ | ||
function isOperationPending(bytes32 id) external view returns (bool); | ||
|
||
/** | ||
* @dev Returns whether an operation is ready for execution. Note that a "ready" operation is also "pending". | ||
*/ | ||
function isOperationReady(bytes32 id) external view returns (bool); | ||
|
||
/** | ||
* @dev Returns whether an operation is done or not. | ||
*/ | ||
function isOperationDone(bytes32 id) external view returns (bool); | ||
|
||
/** | ||
* @dev Returns the timestamp at which an operation becomes ready (0 for | ||
* unset operations, 1 for done operations). | ||
*/ | ||
function getTimestamp(bytes32 id) external view returns (uint256); | ||
|
||
/** | ||
* @dev Returns operation state. | ||
*/ | ||
// function getOperationState(bytes32 id) public view virtual returns (OperationState); | ||
|
||
/** | ||
* @dev Returns the minimum delay in seconds for an operation to become valid. | ||
* | ||
* This value can be changed by executing an operation that calls `updateDelay`. | ||
*/ | ||
function getMinDelay() external view returns (uint256); | ||
|
||
/** | ||
* @dev Returns the identifier of an operation containing a single | ||
* transaction. | ||
*/ | ||
function hashOperation( | ||
address target, | ||
uint256 value, | ||
bytes calldata data, | ||
bytes32 predecessor, | ||
bytes32 salt | ||
) external pure returns (bytes32); | ||
|
||
/** | ||
* @dev Returns the identifier of an operation containing a batch of | ||
* transactions. | ||
*/ | ||
function hashOperationBatch( | ||
address[] calldata targets, | ||
uint256[] calldata values, | ||
bytes[] calldata payloads, | ||
bytes32 predecessor, | ||
bytes32 salt | ||
) external pure returns (bytes32); | ||
|
||
/** | ||
* @dev Schedule an operation containing a single transaction. | ||
* | ||
* Emits {CallSalt} if salt is nonzero, and {CallScheduled}. | ||
* | ||
* Requirements: | ||
* | ||
* - the caller must have the 'proposer' role. | ||
*/ | ||
function schedule( | ||
address target, | ||
uint256 value, | ||
bytes calldata data, | ||
bytes32 predecessor, | ||
bytes32 salt, | ||
uint256 delay | ||
) external; | ||
|
||
/** | ||
* @dev Schedule an operation containing a batch of transactions. | ||
* | ||
* Emits {CallSalt} if salt is nonzero, and one {CallScheduled} event per transaction in the batch. | ||
* | ||
* Requirements: | ||
* | ||
* - the caller must have the 'proposer' role. | ||
*/ | ||
function scheduleBatch( | ||
address[] calldata targets, | ||
uint256[] calldata values, | ||
bytes[] calldata payloads, | ||
bytes32 predecessor, | ||
bytes32 salt, | ||
uint256 delay | ||
) external; | ||
|
||
/** | ||
* @dev Cancel an operation. | ||
* | ||
* Requirements: | ||
* | ||
* - the caller must have the 'canceller' role. | ||
*/ | ||
function cancel(bytes32 id) external; | ||
|
||
/** | ||
* @dev Execute an (ready) operation containing a single transaction. | ||
* | ||
* Emits a {CallExecuted} event. | ||
* | ||
* Requirements: | ||
* | ||
* - the caller must have the 'executor' role. | ||
*/ | ||
// This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending, | ||
// thus any modifications to the operation during reentrancy should be caught. | ||
// slither-disable-next-line reentrancy-eth | ||
function execute( | ||
address target, | ||
uint256 value, | ||
bytes calldata payload, | ||
bytes32 predecessor, | ||
bytes32 salt | ||
) external; | ||
|
||
/** | ||
* @dev Execute an (ready) operation containing a batch of transactions. | ||
* | ||
* Emits one {CallExecuted} event per transaction in the batch. | ||
* | ||
* Requirements: | ||
* | ||
* - the caller must have the 'executor' role. | ||
*/ | ||
// This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending, | ||
// thus any modifications to the operation during reentrancy should be caught. | ||
// slither-disable-next-line reentrancy-eth | ||
function executeBatch( | ||
address[] calldata targets, | ||
uint256[] calldata values, | ||
bytes[] calldata payloads, | ||
bytes32 predecessor, | ||
bytes32 salt | ||
) external payable; | ||
|
||
/** | ||
* @dev Changes the minimum timelock duration for future operations. | ||
* | ||
* Emits a {MinDelayChange} event. | ||
* | ||
* Requirements: | ||
* | ||
* - the caller must be the timelock itself. This can only be achieved by scheduling and later executing | ||
* an operation where the timelock is the target and the data is the ABI-encoded call to this function. | ||
*/ | ||
function updateDelay(uint256 newDelay) external; | ||
} |
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,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/transparent/ProxyAdmin.sol) | ||
|
||
pragma solidity 0.8.24; | ||
|
||
interface IProxyAdmin { | ||
/** | ||
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgrade(address)` | ||
* and `upgradeAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, | ||
* while `upgradeAndCall` will invoke the `receive` function if the second argument is the empty byte string. | ||
* If the getter returns `"5.0.0"`, only `upgradeAndCall(address,bytes)` is present, and the second argument must | ||
* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function | ||
* during an upgrade. | ||
*/ | ||
function UPGRADE_INTERFACE_VERSION() external returns (string memory); | ||
|
||
/** | ||
* @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. | ||
* See {TransparentUpgradeableProxy-_dispatchUpgradeToAndCall}. | ||
* | ||
* Requirements: | ||
* | ||
* - This contract must be the admin of `proxy`. | ||
* - If `data` is empty, `msg.value` must be zero. | ||
*/ | ||
function upgradeAndCall( | ||
address proxy, | ||
address implementation, | ||
bytes memory data | ||
) external payable; | ||
} |
Oops, something went wrong.