File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/contracts/src.ts Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1166,6 +1166,16 @@ export class ContractFactory {
1166
1166
logger . throwError ( "cannot override " + key , Logger . errors . UNSUPPORTED_OPERATION , { operation : key } )
1167
1167
} ) ;
1168
1168
1169
+ if ( tx . value ) {
1170
+ const value = BigNumber . from ( tx . value ) ;
1171
+ if ( ! value . isZero ( ) && ! this . interface . deploy . payable ) {
1172
+ logger . throwError ( "non-payable constructor cannot override value" , Logger . errors . UNSUPPORTED_OPERATION , {
1173
+ operation : "overrides.value" ,
1174
+ value : tx . value
1175
+ } ) ;
1176
+ }
1177
+ }
1178
+
1169
1179
// Make sure the call matches the constructor signature
1170
1180
logger . checkArgumentCount ( args . length , this . interface . deploy . inputs . length , " in Contract constructor" ) ;
1171
1181
You can’t perform that action at this time.
0 commit comments