@@ -46,9 +46,11 @@ contract FastBridgeReceiverOnEthereum is SafeBridgeReceiverOnEthereum, IFastBrid
4646 // * Storage * //
4747 // ************************************* //
4848
49+ uint256 public constant ONE_BASIS_POINT = 1e4 ; // One basis point, for scaling.
4950 uint256 public override claimDeposit;
5051 uint256 public override challengeDeposit;
5152 uint256 public override challengeDuration;
53+ uint256 public override alpha; // Basis point of claim or challenge deposit that are lost when dishonest.
5254 mapping (uint256 => Ticket) public tickets; // The tickets by ticketID.
5355
5456 // ************************************* //
@@ -64,11 +66,13 @@ contract FastBridgeReceiverOnEthereum is SafeBridgeReceiverOnEthereum, IFastBrid
6466 address _inbox ,
6567 uint256 _claimDeposit ,
6668 uint256 _challengeDeposit ,
67- uint256 _challengeDuration
69+ uint256 _challengeDuration ,
70+ uint256 _alpha
6871 ) SafeBridgeReceiverOnEthereum (_governor, _safeBridgeSender, _inbox) {
6972 claimDeposit = _claimDeposit;
7073 challengeDeposit = _challengeDeposit;
7174 challengeDuration = _challengeDuration;
75+ alpha = _alpha;
7276 }
7377
7478 // ************************************* //
@@ -154,7 +158,7 @@ contract FastBridgeReceiverOnEthereum is SafeBridgeReceiverOnEthereum, IFastBrid
154158 require (ticket.claim.bridger != address (0 ), "Claim does not exist " );
155159 require (ticket.claim.verified == true , "Claim not verified: deposit forfeited " );
156160
157- uint256 amount = ticket.claim.claimDeposit + ticket.challenge.challengeDeposit;
161+ uint256 amount = ticket.claim.claimDeposit + ( ticket.challenge.challengeDeposit * alpha) / ONE_BASIS_POINT ;
158162 ticket.claim.claimDeposit = 0 ;
159163 ticket.challenge.challengeDeposit = 0 ;
160164 payable (ticket.claim.bridger).send (amount); // Use of send to prevent reverting fallback. User is responsibility for accepting ETH.
@@ -167,7 +171,7 @@ contract FastBridgeReceiverOnEthereum is SafeBridgeReceiverOnEthereum, IFastBrid
167171 require (ticket.challenge.challenger != address (0 ), "Challenge does not exist " );
168172 require (ticket.claim.verified == false , "Claim verified: deposit forfeited " );
169173
170- uint256 amount = ticket.claim.claimDeposit + ticket.challenge.challengeDeposit ;
174+ uint256 amount = ticket.challenge.challengeDeposit + ( ticket.claim.claimDeposit * alpha) / ONE_BASIS_POINT ;
171175 ticket.claim.claimDeposit = 0 ;
172176 ticket.challenge.challengeDeposit = 0 ;
173177 payable (ticket.challenge.challenger).send (amount); // Use of send to prevent reverting fallback. User is responsibility for accepting ETH.
@@ -203,6 +207,10 @@ contract FastBridgeReceiverOnEthereum is SafeBridgeReceiverOnEthereum, IFastBrid
203207 challengeDuration = _challengeDuration;
204208 }
205209
210+ function changeAlpha (uint256 _alpha ) external onlyByGovernor {
211+ alpha = _alpha;
212+ }
213+
206214 // ************************ //
207215 // * Internal * //
208216 // ************************ //
0 commit comments