Skip to content

Commit e2907bb

Browse files
committed
wip
1 parent 1ffe977 commit e2907bb

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

_QUICKSTART.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,19 @@ scp -r $SOURCE root@$REMOTE_IP:$DESTINATION
124124
Example output:
125125
```
126126
res queryPubkey: {
127-
encryption_key: 'AtDOG9EBwaKhMBheTGPR1wkduasNyjxlGZjTFKFVAyPA',
128-
verification_key: '0x04d0ce1bd101c1a2a130185e4c63d1d7091db9ab0dca3c651998d314a1550323c02649b0960b00bb1fac896aaf4056abb605e87d55ec1805a91ddb3e32c6b89c36'
127+
encryption_key: '...',
128+
verification_key: '0x...'
129129
}
130130
```
131131
132132
* Paste them into deploy.ts, `gatewayContractPublicKey` with `verification_key` and `gatewayContractEncryptionKeyForChaChaPoly1305` with `encryption_key`
133133
134-
# UPDATE IF DIFFERS deploy.ts
134+
* UPDATE CONFIG AND RUN ON LOCAL IF DIFFERS
135+
```bash
136+
SOURCE=/Users/luke/code/clones/github/svub/nunya/packages/secret-contracts-scripts/src/config/deploy.ts
137+
DESTINATION=/root/nunya/packages/secret-contracts-scripts/src/config/deploy.ts
138+
scp -r $SOURCE root@$REMOTE_IP:$DESTINATION
139+
```
135140

136141
```bash
137142
yarn run secret:clean

_SETUP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ git submodule update --init --recursive
365365
Example output:
366366
```
367367
res queryPubkey: {
368-
encryption_key: 'AtDOG9EBwaKhMBheTGPR1wkduasNyjxlGZjTFKFVAyPA',
369-
verification_key: '0x04d0ce1bd101c1a2a130185e4c63d1d7091db9ab0dca3c651998d314a1550323c02649b0960b00bb1fac896aaf4056abb605e87d55ec1805a91ddb3e32c6b89c36'
368+
encryption_key: '...',
369+
verification_key: '0x...'
370370
}
371371
```
372372

packages/hardhat/contracts/Gateway.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ contract Gateway is Ownable, Utils, Base64 {
5858

5959
bytes public owner_public_key;
6060

61+
bytes28 public gatewayAddressBase64 = encodeAddressToBase64(address(this));
62+
6163
/*//////////////////////////////////////////////////////////////
6264
Structs
6365
//////////////////////////////////////////////////////////////*/
@@ -511,8 +513,7 @@ contract Gateway is Ownable, Utils, Base64 {
511513

512514
// Note - It is only possible to call this function `encodeAddressToBase64` three times
513515
// in this function, otherwise it generates error `Error: Transaction reverted without a reason`.
514-
bytes28 senderAddressBase64 = encodeAddressToBase64(msg.sender);
515-
bytes28 gatewayAddressBase64 = encodeAddressToBase64(address(this));
516+
// bytes28 senderAddressBase64 = encodeAddressToBase64(msg.sender);
516517

517518
requestId = taskId;
518519

@@ -717,9 +718,6 @@ contract Gateway is Ownable, Utils, Base64 {
717718
function retrievePubkey(uint256 _callbackSelector, uint32 _callbackGasLimit) external payable onlyOwner returns (uint256 requestId) {
718719
console.log("------ Gateway.retrievePubkey");
719720

720-
bytes28 senderAddressBase64 = encodeAddressToBase64(address(msg.sender));
721-
bytes28 gatewayAddressBase64 = encodeAddressToBase64(address(this));
722-
723721
requestId = taskId;
724722

725723
// TODO: optionally add guard to verify value of _callbackSelector if necessary
@@ -737,6 +735,8 @@ contract Gateway is Ownable, Utils, Base64 {
737735
require(msg.value >= estimatedPrice, "Paid Callback Fee Too Low");
738736
}
739737

738+
bytes memory userKey = bytes.concat("A4MYU1tUEF1Keq5gwI/EX5aHGBtP38YlvRp1P6c5f+11");
739+
740740
// Note: Since contracts only have an address, but not public keys, where the
741741
// addresses are derived from the address of the user (or other contract) that
742742
// created them, which are in turn are derived from the public key of a normal
@@ -750,7 +750,7 @@ contract Gateway is Ownable, Utils, Base64 {
750750
'}","routing_info":"', routing_info,
751751
'","routing_code_hash":"', routing_code_hash,
752752
'","user_address":"', address(msg.sender),
753-
'","user_key":"', senderAddressBase64,
753+
'","user_key":"', userKey,
754754
'","callback_address":"'
755755
);
756756

packages/secret-contracts-scripts/src/config/deploy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ const config = {
8484
secretGateway: {
8585
gatewayContractCodeId: "1", // only know after upload
8686
gatewayContractAddress: "secret1mfk7n6mc2cg6lznujmeckdh4x0a5ezf6hx6y8q", // only know after instantiate
87-
gatewayContractCodeHash: "836a34c60637d684c044d4ddc1277e3d21ae1f440d2bb2d26870c81639d2f4c4", // only know after upload
87+
gatewayContractCodeHash: "b9fb512153812cd554884922d10c007bef9d2749d14ae9fda445e83710ee8c10", // only know after upload
8888
// obtain from running `yarn run secret:querySecretGatewayPubkey`
89-
gatewayContractPublicKey: "0x04d0ce1bd101c1a2a130185e4c63d1d7091db9ab0dca3c651998d314a1550323c02649b0960b00bb1fac896aaf4056abb605e87d55ec1805a91ddb3e32c6b89c36",
89+
gatewayContractPublicKey: "0x04c545d3a2aa0d070a579beca7eca512a1b6c84a027a2e7df0b9caad10190cf45d14495e7c0d04e9cc9b16205cce6ef4b2a1b1b613aaae97753be3379519b3cc7f",
9090
// obtain from running `yarn run secret:querySecretGatewayPubkey`
91-
gatewayContractEncryptionKeyForChaChaPoly1305: "AtDOG9EBwaKhMBheTGPR1wkduasNyjxlGZjTFKFVAyPA",
91+
gatewayContractEncryptionKeyForChaChaPoly1305: "A8VF06KqDQcKV5vsp+ylEqG2yEoCei598LnKrRAZDPRd",
9292
gatewayContractWasmPath: "secret-gateway-contract.wasm.gz",
9393
}
9494
}

0 commit comments

Comments
 (0)