@@ -411,17 +411,14 @@ def sign_bid(
411
411
"verifyingContract" : opportunity .eip_712_domain .verifying_contract ,
412
412
}
413
413
message_types = {
414
- "SignedParams" : [
415
- {"name" : "executionParams" , "type" : "ExecutionParams" },
416
- {"name" : "signer" , "type" : "address" },
417
- {"name" : "deadline" , "type" : "uint256" },
418
- ],
419
414
"ExecutionParams" : [
420
415
{"name" : "sellTokens" , "type" : "TokenAmount[]" },
421
416
{"name" : "buyTokens" , "type" : "TokenAmount[]" },
417
+ {"name" : "executor" , "type" : "address" },
422
418
{"name" : "targetContract" , "type" : "address" },
423
419
{"name" : "targetCalldata" , "type" : "bytes" },
424
420
{"name" : "targetCallValue" , "type" : "uint256" },
421
+ {"name" : "validUntil" , "type" : "uint256" },
425
422
{"name" : "bidAmount" , "type" : "uint256" },
426
423
],
427
424
"TokenAmount" : [
@@ -432,30 +429,26 @@ def sign_bid(
432
429
433
430
# the data to be signed
434
431
message_data = {
435
- "executionParams" : {
436
- "sellTokens" : [
437
- {
438
- "token" : token .token ,
439
- "amount" : int (token .amount ),
440
- }
441
- for token in opportunity .sell_tokens
442
- ],
443
- "buyTokens" : [
444
- {
445
- "token" : token .token ,
446
- "amount" : int (token .amount ),
447
- }
448
- for token in opportunity .buy_tokens
449
- ],
450
- "targetContract" : opportunity .target_contract ,
451
- "targetCalldata" : bytes .fromhex (
452
- opportunity .target_calldata .replace ("0x" , "" )
453
- ),
454
- "targetCallValue" : opportunity .target_call_value ,
455
- "bidAmount" : bid_amount ,
456
- },
457
- "signer" : executor ,
458
- "deadline" : valid_until ,
432
+ "sellTokens" : [
433
+ {
434
+ "token" : token .token ,
435
+ "amount" : int (token .amount ),
436
+ }
437
+ for token in opportunity .sell_tokens
438
+ ],
439
+ "buyTokens" : [
440
+ {
441
+ "token" : token .token ,
442
+ "amount" : int (token .amount ),
443
+ }
444
+ for token in opportunity .buy_tokens
445
+ ],
446
+ "executor" : executor ,
447
+ "targetContract" : opportunity .target_contract ,
448
+ "targetCalldata" : bytes .fromhex (opportunity .target_calldata .replace ("0x" , "" )),
449
+ "targetCallValue" : opportunity .target_call_value ,
450
+ "validUntil" : valid_until ,
451
+ "bidAmount" : bid_amount ,
459
452
}
460
453
461
454
signed_typed_data = Account .sign_typed_data (
0 commit comments