@@ -19,6 +19,7 @@ const PermissionedGenericHandlerContract = artifacts.require(
19
19
const FeeRouterContract = artifacts . require ( "FeeHandlerRouter" ) ;
20
20
const BasicFeeHandlerContract = artifacts . require ( "BasicFeeHandler" ) ;
21
21
const DynamicFeeHandlerContract = artifacts . require ( "DynamicERC20FeeHandlerEVM" ) ;
22
+ const PercentageFeeHandler = artifacts . require ( "PercentageERC20FeeHandlerEVM" ) ;
22
23
23
24
module . exports = async function ( deployer , network ) {
24
25
const networksConfig = Utils . getNetworksConfig ( ) ;
@@ -76,6 +77,11 @@ module.exports = async function (deployer, network) {
76
77
bridgeInstance . address ,
77
78
feeRouterInstance . address
78
79
) ;
80
+ const percentageFeeHandlerInstance = await deployer . deploy (
81
+ PercentageFeeHandler ,
82
+ bridgeInstance . address ,
83
+ feeRouterInstance . address
84
+ )
79
85
80
86
// setup fee router and fee handlers
81
87
await bridgeInstance . adminChangeFeeHandler ( feeRouterInstance . address ) ;
@@ -89,6 +95,9 @@ module.exports = async function (deployer, network) {
89
95
await basicFeeHandlerInstance . changeFee (
90
96
Ethers . utils . parseEther ( currentNetworkConfig . fee . basic . fee ) . toString ( )
91
97
) ;
98
+ await percentageFeeHandlerInstance . changeFee (
99
+ currentNetworkConfig . fee . percentage . fee
100
+ )
92
101
93
102
console . table ( {
94
103
"Deployer Address" : deployerAddress ,
@@ -101,6 +110,7 @@ module.exports = async function (deployer, network) {
101
110
"FeeRouterContract Address" : feeRouterInstance . address ,
102
111
"BasicFeeHandler Address" : basicFeeHandlerInstance . address ,
103
112
"DynamicFeeHandler Address" : dynamicFeeHandlerInstance . address ,
113
+ "PercentageFeeHandler Address" : percentageFeeHandlerInstance . address
104
114
} ) ;
105
115
106
116
// setup erc20 tokens
@@ -116,8 +126,14 @@ module.exports = async function (deployer, network) {
116
126
feeRouterInstance ,
117
127
dynamicFeeHandlerInstance ,
118
128
basicFeeHandlerInstance ,
129
+ percentageFeeHandlerInstance ,
119
130
erc20
120
131
) ;
132
+ await percentageFeeHandlerInstance . changeFeeBounds (
133
+ erc20 . resourceID ,
134
+ Ethers . utils . parseEther ( currentNetworkConfig . fee . percentage . lowerBound ) . toString ( ) ,
135
+ Ethers . utils . parseEther ( currentNetworkConfig . fee . percentage . upperBound ) . toString ( )
136
+ )
121
137
122
138
console . log (
123
139
"-------------------------------------------------------------------------------"
@@ -143,6 +159,7 @@ module.exports = async function (deployer, network) {
143
159
feeRouterInstance ,
144
160
dynamicFeeHandlerInstance ,
145
161
basicFeeHandlerInstance ,
162
+ percentageFeeHandlerInstance ,
146
163
erc721
147
164
) ;
148
165
@@ -168,6 +185,7 @@ module.exports = async function (deployer, network) {
168
185
feeRouterInstance ,
169
186
dynamicFeeHandlerInstance ,
170
187
basicFeeHandlerInstance ,
188
+ percentageFeeHandlerInstance ,
171
189
generic
172
190
) ;
173
191
0 commit comments