forked from Snowfork/snowbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fee multiplier to protocol (Snowfork#1161)
* Add fee multiplier * The base fee and exchange rate should be multiplied separately * Add FEE_MULTIPLIER to E2E config * Update web/packages/test/scripts/set-env.sh Co-authored-by: Alistair Singh <[email protected]> * Make multiplier non-linear * Add gateway upgrade for Rococo --------- Co-authored-by: Alistair Singh <[email protected]>
- Loading branch information
1 parent
8a51ac9
commit cc6f123
Showing
7 changed files
with
74 additions
and
20 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
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,33 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.23; | ||
|
||
import "../../Gateway.sol"; | ||
|
||
import {UD60x18, convert} from "prb/math/src/UD60x18.sol"; | ||
import {PricingStorage} from "../../storage/PricingStorage.sol"; | ||
|
||
contract GatewayV2 is Gateway { | ||
constructor( | ||
address beefyClient, | ||
address agentExecutor, | ||
ParaID bridgeHubParaID, | ||
bytes32 bridgeHubAgentID, | ||
uint8 foreignTokenDecimals | ||
) Gateway(beefyClient, agentExecutor, bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals) {} | ||
|
||
function initialize(bytes memory data) external override { | ||
// Prevent initialization of storage in implementation contract | ||
if (ERC1967.load() == address(0)) { | ||
revert Unauthorized(); | ||
} | ||
|
||
PricingStorage.Layout storage pricing = PricingStorage.layout(); | ||
|
||
if (pricing.multiplier != convert(0)) { | ||
revert AlreadyInitialized(); | ||
} | ||
|
||
pricing.multiplier = abi.decode(data, (UD60x18)); | ||
} | ||
} |
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