@@ -53,6 +53,8 @@ contract Gateway is Ownable, Utils {
5353 string public routing_info = "" ;
5454 string public routing_code_hash = "" ;
5555
56+ bytes public owner_public_key;
57+
5658 /*//////////////////////////////////////////////////////////////
5759 Structs
5860 //////////////////////////////////////////////////////////////*/
@@ -267,10 +269,11 @@ contract Gateway is Ownable, Utils {
267269 event FulfilledRequestValue (uint256 indexed requestId );
268270
269271 // Constructor
270- constructor (address nunyaContractAddress ) {
272+ constructor (address nunyaContractAddress , bytes memory deployerPublicKeyBytes ) {
271273 // Initializer
272274 // Set owner to be the deployed NunyaBusiness.sol contract
273275 owner = nunyaContractAddress;
276+ owner_public_key = deployerPublicKeyBytes;
274277
275278 taskId = 1 ;
276279 nonce = 0 ;
@@ -502,7 +505,7 @@ contract Gateway is Ownable, Utils {
502505
503506 // Note - It is only possible to call this function `encodeAddressToBase64` three times
504507 // in this function, otherwise it generates error `Error: Transaction reverted without a reason`.
505- bytes28 senderAddressBase64 = encodeAddressToBase64 (address ( msg .sender ) );
508+ bytes28 senderAddressBase64 = encodeAddressToBase64 (msg .sender );
506509
507510 requestId = taskId;
508511
@@ -543,9 +546,7 @@ contract Gateway is Ownable, Utils {
543546 bytes memory payload_info = abi.encodePacked (
544547 '}","routing_info":" ' ,routing_info,
545548 '","routing_code_hash":" ' ,routing_code_hash,
546- '","user_address":" ' ,address (msg .sender ),
547- '","user_key":" ' ,senderAddressBase64,
548- '","callback_address":" '
549+ '","user_address":"0x0000","user_key":"AAA=","callback_address":" '
549550 );
550551
551552 //
@@ -559,12 +560,12 @@ contract Gateway is Ownable, Utils {
559560 // );
560561 // console.log("------ Gateway.requestValue - payload_info: ", payload_info);
561562
562- uint32 _myArg = 123 ;
563+ // uint32 _myArg = 123;
563564 //construct the payload that is sent into the Secret Gateway
564565 // FIXME: Error parsing into type secret_gateway::types::Payload: Invalid unicode code point.: execute contract failed
565566 bytes memory payload = bytes .concat (
566567 '{"data":"{\ \" myArg\ \" : ' ,
567- uint256toBytesString (_myArg ),
568+ uint256toBytesString (123 ),
568569 payload_info,
569570 senderAddressBase64, //callback_address
570571 // callback selector should be a hex value already converted into base64 to be used
@@ -597,12 +598,12 @@ contract Gateway is Ownable, Utils {
597598 bytes memory emptyBytes = hex "0000 " ;
598599
599600 // TODO - make `user_key` a unique key different from `user_pubkey`
600- bytes memory userKey = bytes .concat (senderAddressBase64); // equals AAA= in base64
601+ // bytes memory userKey = bytes.concat(senderAddressBase64); // equals AAA= in base64
601602
602603 // ExecutionInfo struct
603604 ExecutionInfo memory executionInfo = ExecutionInfo ({
604- user_key: userKey, // FIXME - use this instead when resolve issue
605- // user_key: emptyBytes,
605+ // user_key: userKey, // FIXME - use this instead when resolve issue
606+ user_key: emptyBytes, // equals AAA= in base64
606607 // FIXME: use of `secret_gateway_signer_pubkey` does not compile, what alternative to use?
607608 // user_pubkey: uint256toBytesString(secret_gateway_signer_pubkey),
608609 user_pubkey: emptyBytes, // Fill with 0 bytes
@@ -614,7 +615,7 @@ contract Gateway is Ownable, Utils {
614615 payload: payload,
615616 // TODO: add a payload signature
616617 // Signature of hash of encrypted input values
617- payload_signature: emptyBytes
618+ payload_signature: emptyBytes // empty signature, fill with 0 bytes
618619 // payload_signature: bytes32ToBytes(payloadHash)
619620 });
620621
0 commit comments