-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
8de18f0
commit d00a2b1
Showing
15 changed files
with
337 additions
and
170 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
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
Submodule forge-std
updated
22 files
+48 −6 | .github/workflows/ci.yml | |
+29 −0 | .github/workflows/sync.yml | |
+1 −1 | foundry.toml | |
+1 −1 | package.json | |
+5 −3 | src/Base.sol | |
+4 −3 | src/Script.sol | |
+13 −12 | src/StdChains.sol | |
+195 −17 | src/StdCheats.sol | |
+1 −1 | src/StdInvariant.sol | |
+4 −0 | src/StdStorage.sol | |
+2 −2 | src/StdStyle.sol | |
+11 −2 | src/StdUtils.sol | |
+4 −3 | src/Test.sol | |
+133 −24 | src/Vm.sol | |
+394 −382 | src/console2.sol | |
+13,248 −0 | src/safeconsole.sol | |
+91 −36 | test/StdChains.t.sol | |
+204 −12 | test/StdCheats.t.sol | |
+17 −2 | test/StdMath.t.sol | |
+10 −0 | test/StdStorage.t.sol | |
+4 −4 | test/StdStyle.t.sol | |
+53 −8 | test/StdUtils.t.sol |
Submodule openzeppelin-contracts
updated
537 files
Submodule openzeppelin-contracts-upgradeable
updated
549 files
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,20 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.18; | ||
|
||
import "forge-std/Script.sol"; | ||
import "../src/Bridge.sol"; | ||
|
||
contract UpgradeTokens is Script { | ||
function run() external { | ||
vm.startBroadcast(); | ||
Bridge lldBridge = Bridge(vm.envAddress("LLDBridgeProxy")); | ||
Bridge llmBridge = Bridge(vm.envAddress("LLMBridgeProxy")); | ||
WrappedToken lldProxy = lldBridge.token(); | ||
WrappedToken llmProxy = llmBridge.token(); | ||
|
||
WrappedToken newTokenImpl = new WrappedToken(); | ||
|
||
lldProxy.upgradeTo(address(newTokenImpl)); | ||
llmProxy.upgradeTo(address(newTokenImpl)); | ||
} | ||
} |
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,33 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.18; | ||
|
||
/// @title Interface with events emitted by the bridge | ||
interface BridgeEvents { | ||
/// Emitted after burn, notifies relays that transfer is happening | ||
/// @param from Account that burned its tokens | ||
/// @param substrateRecipient Who should get tokens on substrate | ||
/// @param amount Amount of token burned | ||
event OutgoingReceipt(address indexed from, bytes32 indexed substrateRecipient, uint256 amount); | ||
|
||
/// Bridge get activated or deactivated | ||
/// @param newBridgeState New bridge state | ||
event StateChanged(bool newBridgeState); | ||
|
||
/// An IncomingReceipt was approved for transfer. `mint(bytes32)` | ||
/// can now be called for this receipt after `mintDelay` blocks pass. | ||
/// @param receiptId Receipt that got approved | ||
event Approved(bytes32 indexed receiptId); | ||
|
||
/// Vote was cast to approve IncomingReceipt | ||
/// @param receiptId subject Receipt | ||
/// @param relay Relay that cast the vote | ||
event Vote(bytes32 indexed receiptId, address indexed relay, uint64 substrateBlockNumber); | ||
|
||
/// IncomingReceipt was completely processed - tokens were minted | ||
/// @param receiptId subject Receipt | ||
event Processed(bytes32 indexed receiptId); | ||
|
||
/// Bridge was emergency stopped by watcher - misbehavior by relay was | ||
/// detected | ||
event EmergencyStop(); | ||
} |
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,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.18; | ||
|
||
/// Struct for representing Substrate -> ETH transfer | ||
struct IncomingReceiptStruct { | ||
uint64 substrateBlockNumber; | ||
address ethRecipient; | ||
uint256 amount; | ||
uint256 approvedOn; | ||
uint256 processedOn; | ||
} | ||
|
||
/// Rate limit parameters. Limit how fast can tokens be minted.This is | ||
/// implemented as The Leaky Bucket as a Meter algorithm - | ||
/// https://en.wikipedia.org/wiki/Leaky_bucket. | ||
/// `counterLimit` is the max counter (a.k.a. max burst, max single withdrawal) | ||
/// `decayRate` is after reaching max, how much can be minted per block. | ||
struct RateLimitParameters { | ||
uint256 counterLimit; | ||
uint256 decayRate; | ||
} | ||
|
||
/// Struct for keeping track of counters required to enforce rate limits | ||
struct RateLimitCounter { | ||
uint256 counter; | ||
uint256 lastUpdate; | ||
} |
Oops, something went wrong.