@@ -524,6 +524,17 @@ contract Gateway is Ownable, Utils {
524524 require (msg .value >= estimatedPrice, "Paid Callback Fee Too Low " );
525525 }
526526
527+ // TODO - make `user_key` a unique key different from `user_pubkey`
528+ // bytes memory userKey = bytes.concat(senderAddressBase64); // equals AAA= in base64
529+ // FIXME: failed to validate transaction. Message contains mismatched contract hash
530+ // bytes memory userKey = bytes.concat(owner_public_key); // equals AAA= in base64
531+ // secret1glfedwlusunwly7q05umghzwl6nf2vj6wr38fg
532+ // Note: Find the public key from the account_info in the Relayer logs
533+ // '/cosmos.crypto.secp256k1.PubKey', 'key':
534+ // Encode A4K+MyJNnNcdt78SncjhArLWNnDRHapkZFsemjmf9/7A to base64:
535+ // QTRLK015Sk5uTmNkdDc4U25jamhBckxXTm5EUkhhcGtaRnNlbWptZjkvN0E=
536+ bytes memory userKey = bytes .concat ("A4K+MyJNnNcdt78SncjhArLWNnDRHapkZFsemjmf9/7A " );
537+
527538 // Note: Since contracts only have an address, but not public keys, where the
528539 // addresses are derived from the address of the user (or other contract) that
529540 // created them, which are in turn are derived from the public key of a normal
@@ -547,8 +558,10 @@ contract Gateway is Ownable, Utils {
547558 bytes memory payload_info = abi.encodePacked (
548559 '}","routing_info":" ' ,routing_info,
549560 '","routing_code_hash":" ' ,routing_code_hash,
550- '","user_address":" ' ,address (owner),
551- '","user_key":" ' ,owner_public_key,
561+ // '","user_address":"',address(owner),
562+ // '","user_key":"',owner_public_key,
563+ '","user_address":"secret1glfedwlusunwly7q05umghzwl6nf2vj6wr38fg ' ,
564+ '","user_key":" ' ,userKey,
552565 '","callback_address":" '
553566 // '","user_address":"0x0000","user_key":"AAA=","callback_address":"'
554567 );
@@ -604,17 +617,14 @@ contract Gateway is Ownable, Utils {
604617
605618 bytes memory emptyBytes = hex "0000 " ;
606619
607- // TODO - make `user_key` a unique key different from `user_pubkey`
608- // bytes memory userKey = bytes.concat(senderAddressBase64); // equals AAA= in base64
609- bytes memory userKey = bytes .concat (owner_public_key); // equals AAA= in base64
610-
611620 // ExecutionInfo struct
612621 ExecutionInfo memory executionInfo = ExecutionInfo ({
613622 user_key: userKey, // FIXME - use this instead when resolve issue
614623 // user_key: emptyBytes, // equals AAA= in base64
615624 // FIXME: use of `secret_gateway_signer_pubkey` does not compile, what alternative to use?
616625 // user_pubkey: uint256toBytesString(secret_gateway_signer_pubkey),
617- user_pubkey: owner_public_key,
626+ // user_pubkey: owner_public_key,
627+ user_pubkey: userKey,
618628 // user_pubkey: emptyBytes, // Fill with 0 bytes
619629 routing_code_hash: routing_code_hash, // custom contract codehash on Secret
620630 task_destination_network: task_destination_network,
@@ -624,8 +634,8 @@ contract Gateway is Ownable, Utils {
624634 payload: payload,
625635 // TODO: add a payload signature
626636 // Signature of hash of encrypted input values
627- // payload_signature: emptyBytes // empty signature, fill with 0 bytes
628- payload_signature: bytes32ToBytes (payloadHash)
637+ payload_signature: emptyBytes // empty signature, fill with 0 bytes
638+ // payload_signature: bytes32ToBytes(payloadHash)
629639 });
630640
631641 // persisting the task
0 commit comments