Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: End-to-end request via custom EVM Gateway.sol on Ethereum Local Network to custom Relayer to custom Secret contract on Localsecret with response back and then to NunyaBusiness.sol #33

Merged
merged 177 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
7925a8a
wip submit pubkey
ltfschoen Oct 16, 2024
e718457
Merge branch 'main' into submit-pubkey
ltfschoen Oct 16, 2024
b3dbf1b
Merge branch 'main' into submit-pubkey
ltfschoen Oct 16, 2024
953c751
WIP
ltfschoen Oct 17, 2024
7dc92ca
change callbackSelector to upgradeHandler same as secret_ballz
ltfschoen Nov 2, 2024
0cf285d
WIP: Secret rust compiles
ltfschoen Nov 2, 2024
be6ae52
WIP: Secret rust compiles. Trying to deploy to testnet
ltfschoen Nov 3, 2024
3ec3302
merge latest main where fundGateway reduced to 100000
ltfschoen Nov 3, 2024
6d8999e
clean up txOptions
ltfschoen Nov 3, 2024
812394c
use optimized build
ltfschoen Nov 3, 2024
b7fc6e8
updates after trying with my-counter-contract
ltfschoen Nov 3, 2024
5327898
use secretjs beta whilst testnet being updated. fixes uploading Nunya…
ltfschoen Nov 3, 2024
2fd4616
WIP: separate instantiate from upload
ltfschoen Nov 6, 2024
cdcab0d
WIP
ltfschoen Nov 6, 2024
66bac52
move to cofig file
ltfschoen Nov 6, 2024
b0106bc
docs: Notes based on meeting with Mork
ltfschoen Nov 16, 2024
2cceac2
fix: Use correct address for Secret signer pubkey
ltfschoen Nov 17, 2024
aeda1b8
wip
ltfschoen Nov 17, 2024
bb547fe
wip: Add setGatewayAddressInfo
ltfschoen Nov 19, 2024
0cefaad
fix: Fixes and deploy
ltfschoen Nov 19, 2024
c96ce98
refactor: Add setEVMGatewayAddress and updated deployed Nunya.busines…
ltfschoen Nov 19, 2024
3b52e09
docs: Update readme
ltfschoen Nov 19, 2024
9289214
docs: Update readme rearranging order of deployment
ltfschoen Nov 19, 2024
124cebf
wip: trying to instantiate with secretjs 1.15.0-beta.1 but does not r…
ltfschoen Nov 19, 2024
45e8841
fix: Rename logs folder so logs all visible
ltfschoen Nov 19, 2024
4d6831c
fix: Change nunya_business_contract_address to Vec<u8>
ltfschoen Nov 19, 2024
f15b655
wip: tried changing typs but still instantiate error
ltfschoen Nov 19, 2024
263c370
wip
ltfschoen Nov 19, 2024
ca5f9a0
fix: Fix and deploy custom secret contract
ltfschoen Nov 22, 2024
23fde20
fix: Fix queryPubkey working
ltfschoen Nov 22, 2024
f14da2f
wip
ltfschoen Nov 25, 2024
30cd895
feat: runs some of generateKeys
ltfschoen Nov 25, 2024
775ed89
feat: debugging generateKeys
ltfschoen Nov 25, 2024
a8b5c33
submit runs but with issues
ltfschoen Nov 28, 2024
2c711a5
submit runs but no response from wait and cannot find tx on sepolia
ltfschoen Nov 29, 2024
1400efa
requestValue
ltfschoen Dec 1, 2024
7d6efe3
requestValue logs
ltfschoen Dec 1, 2024
24647dc
docs: Add steps to interact with deployed Gateway EVM contract on Sep…
ltfschoen Dec 2, 2024
38aae5c
fix: Various fixes
ltfschoen Dec 2, 2024
01a00f5
refactor: Move requestValue
ltfschoen Dec 2, 2024
cdb1356
fix: Fix scripts and redeploy but not response from requestValue
ltfschoen Dec 3, 2024
9c9c7a7
fix: Fixes unsafeSetSecretContractInfo
ltfschoen Dec 3, 2024
e60073b
feat: Paid Callback Fee Too Low error from requestValue in Gateway EV…
ltfschoen Dec 4, 2024
8aaf9a2
fix: Fix deploy NunyaBusiness and Gateway to EVM on localhost
ltfschoen Dec 4, 2024
b32578c
chore: remove disused abi file
ltfschoen Dec 5, 2024
e898d0e
feat: setEVMGatewayAddress on localhost works
ltfschoen Dec 5, 2024
531dea0
wip: Relayer
ltfschoen Dec 8, 2024
1b19e09
chore: copy of https://github.com/SecretSaturn/SecretPath/tree/main/T…
ltfschoen Dec 14, 2024
d83147f
fix: Separate files for Secret Gateway and Nunya contract with clean …
ltfschoen Dec 14, 2024
7f4aba3
feat: restore debug-print
ltfschoen Dec 14, 2024
302a714
fix: Capitalize Cargo.toml
ltfschoen Dec 14, 2024
8b48ff9
wip: Try get working debug-print
ltfschoen Dec 14, 2024
d9a2887
wip: Update docs with correct error
ltfschoen Dec 14, 2024
26c7273
debug: Add debugging to secret contracts
ltfschoen Dec 15, 2024
f544711
fix: Remove use of debug-print
ltfschoen Dec 15, 2024
431df57
fix so compiles
ltfschoen Dec 15, 2024
4120a3c
fix: Remove set_debug_handler. Add eprintln debugs instead
ltfschoen Dec 15, 2024
d13af64
fix: Fix wasm-opt to prevent error
ltfschoen Dec 15, 2024
87bc944
fix: Makefile consistent between nunya and gateway secret contracts
ltfschoen Dec 15, 2024
539d327
fix: Consistently name Docker container secretdev. sudo required for …
ltfschoen Dec 15, 2024
d463d96
fix: Fix permissions with using Docker and docker exec. Increase gas …
ltfschoen Dec 15, 2024
9a1be39
chore: Update to use newer version of localsecret Docker container
ltfschoen Dec 15, 2024
d9650d9
chore: Replace setting env vars for Makefile in bash script
ltfschoen Dec 15, 2024
b73b54d
chore: Change to use bash in script instead of dot
ltfschoen Dec 15, 2024
9f83587
fea: uploadGateway
ltfschoen Dec 15, 2024
ab769ba
wip: TypeScript alternative to upload Secret Gateway on localsecret
ltfschoen Dec 15, 2024
c27d97b
wip: Update TODO
ltfschoen Dec 15, 2024
ce63120
wip
ltfschoen Dec 16, 2024
d30901a
refactor: Updates after successful deployment of Secret Gateway on lo…
ltfschoen Dec 17, 2024
d70505f
docs: Show users to use Option A
ltfschoen Dec 17, 2024
0c91347
chore: Add mock values for public key of Secret Gateway deployed on L…
ltfschoen Dec 17, 2024
19d8dfe
chore: Updates after successful deployment of both Secret Gateway con…
ltfschoen Dec 17, 2024
5534452
wip: Try to resolve gas issue calling requestValue
ltfschoen Dec 17, 2024
bf8e268
wip: requestValue works but unable to set userKey since error if call…
ltfschoen Dec 17, 2024
078d1f8
feat: requestValue but temporarily not use userKey due to issue
ltfschoen Dec 17, 2024
3cef4f8
feat: run requestValue when relayer running and record logs
ltfschoen Dec 17, 2024
d96a784
wip: change from owner to msg.sender in requestValue. change callback…
ltfschoen Dec 17, 2024
239cd5e
fix: Change to owner instead of msg.sender so only NunyaBusiness can …
ltfschoen Dec 17, 2024
96282cb
fix: Change to msg.sender again since not an issue when using onlyOwner
ltfschoen Dec 17, 2024
1b0b47e
fix: Reuse encodeAddressToBase64 to avoid calling it too many times t…
ltfschoen Dec 17, 2024
e750cee
fix: Update local gateway address and other tweaks
ltfschoen Dec 18, 2024
227cfdd
docs: Update readme
ltfschoen Dec 19, 2024
2ca0fd6
update docs and improve debugging in Secret Gateway
ltfschoen Dec 19, 2024
6354b52
wip: improvements but relayer error Error parsing into type secret_ga…
ltfschoen Dec 20, 2024
3d72480
docs: Remove old issue now resolved
ltfschoen Dec 20, 2024
666cdce
wip
ltfschoen Dec 20, 2024
e7a1f98
fix: Error parsing into type secret_gateway::types::Payload: invalid …
ltfschoen Dec 20, 2024
89bce8b
fix: Fix syntax
ltfschoen Dec 20, 2024
2b81045
logs: Update logs Generic error: Only NunyaBusiness contract can call…
ltfschoen Dec 20, 2024
2650863
docs: Mention what msg.user_address is at Secret contract
ltfschoen Dec 20, 2024
e4f287b
fix: Add correct Secret logs to match Relayer logs
ltfschoen Dec 20, 2024
1446e7a
fix: Fix debugging
ltfschoen Dec 21, 2024
afb39d1
wip: Try to fix publickey error in Gateway
ltfschoen Dec 21, 2024
17851ce
fix: Fix so correct nunya evm address is stored in secret contract on…
ltfschoen Dec 21, 2024
eb4e1f8
wip: try to fix invalid contract error
ltfschoen Dec 21, 2024
6877731
docs: Add Message contains mismatched contract hash error
ltfschoen Dec 21, 2024
00a1e95
wip: verify the internal verification key matches the user address
ltfschoen Dec 21, 2024
105b4ec
wip: Calls try_handle but then public key error
ltfschoen Dec 21, 2024
d4eebff
wip: Still getting malformed public key error
ltfschoen Dec 21, 2024
e9e702a
wip: try to improve submitRequestValue
ltfschoen Dec 21, 2024
3602e83
fix: Update submitRequestValue to use the correct Localsecret public …
ltfschoen Dec 22, 2024
b8e822f
wip: Solves verify the internal verification key matches the user add…
ltfschoen Dec 22, 2024
4c6affd
wip: Use differerent values for user_pubkey and user_key in Execution…
ltfschoen Dec 22, 2024
b85e410
chore: Improve debugging for Secret Gateway to check why decryption n…
ltfschoen Dec 22, 2024
f3a818a
wip
ltfschoen Dec 22, 2024
1ffe977
fix Secret gateway decrypt debugging
ltfschoen Dec 22, 2024
e2907bb
wip
ltfschoen Dec 22, 2024
c99289b
docs: Error Message contains mismatched contract hash due to recent c…
ltfschoen Dec 22, 2024
ed6feb8
Revert "docs: Error Message contains mismatched contract hash due to …
ltfschoen Dec 22, 2024
b85d86e
Revert "wip"
ltfschoen Dec 22, 2024
0c80aca
Revert "fix Secret gateway decrypt debugging"
ltfschoen Dec 22, 2024
6488809
Revert "wip"
ltfschoen Dec 22, 2024
3bb25a9
Revert "chore: Improve debugging for Secret Gateway to check why decr…
ltfschoen Dec 22, 2024
5d218a8
wip
ltfschoen Dec 22, 2024
a1de0b9
wip: malformed public key
ltfschoen Dec 22, 2024
9774235
wip: Set admin of Secret Gateway to secret1glfedwlusunwly7q05umghzwl6…
ltfschoen Dec 22, 2024
4c0b913
wip
ltfschoen Dec 22, 2024
32f1a4b
wip
ltfschoen Dec 23, 2024
8fd4340
wip: Try to improve submitRequestValue
ltfschoen Dec 23, 2024
a5efc05
revert change to msg.rs in Secret Gateway until know why changes caus…
ltfschoen Dec 24, 2024
fa96c7e
improve debugging in Secret Gateway. update docs that need to update …
ltfschoen Dec 24, 2024
1a8e5d1
logs: Update logs after updating Secret Gateway with improved debugging
ltfschoen Dec 24, 2024
80c31a6
fix: Fix use of Secret Gateway ephemeral keys to generate user_pubkey…
ltfschoen Dec 24, 2024
30f451e
docs: Add fixme to use random nonce
ltfschoen Dec 24, 2024
482ed9a
update logs
ltfschoen Dec 24, 2024
730a13c
tweak Secret Nunya contract debugging
ltfschoen Dec 24, 2024
8857251
fix tweak Secret Nunya contract debugging
ltfschoen Dec 24, 2024
3ce2562
fix
ltfschoen Dec 24, 2024
c862dc2
fix: Fix gateway_key to Binary and use .as_slice like in ev-kv-store-…
ltfschoen Dec 24, 2024
cf17719
fix: Fix type of gateway_key to be Binary
ltfschoen Dec 25, 2024
db89019
fix: Fixes error Generic error: Invalid public key format
ltfschoen Dec 25, 2024
74b4674
debugging Nunya contract request_value
ltfschoen Dec 25, 2024
641f208
fix: Fix invalid type error in request_value
ltfschoen Dec 25, 2024
67e3211
attempt e2e submitRequestValue
ltfschoen Dec 25, 2024
9a9b476
fix: attempt e2e submitRequestValue
ltfschoen Dec 25, 2024
78fb554
fix: attempt e2e submitRequestValue
ltfschoen Dec 25, 2024
956c78b
fix: attempt e2e submitRequestValue
ltfschoen Dec 25, 2024
47fa5ec
fix: Finished getting submitRequestValue working e2e
ltfschoen Dec 25, 2024
7c040db
wip: Impossible to get requestValue to work so documented reasons why…
ltfschoen Dec 26, 2024
761d2d9
wip: Simplify
ltfschoen Dec 26, 2024
6a98984
wip: unsafeRequestValue request via NunyaBusiness to send in Gateway …
ltfschoen Dec 26, 2024
48fa26b
fix: Use correct contract for iface value
ltfschoen Dec 26, 2024
2a2e97a
refactor: Refactor to use common script to call requestValue and retr…
ltfschoen Dec 26, 2024
3cdcb6a
fixes
ltfschoen Dec 26, 2024
defa7e3
fix naming
ltfschoen Dec 26, 2024
f384a89
fix missing bracket
ltfschoen Dec 26, 2024
2780adb
fix: remove unsupported Solidity console.logs
ltfschoen Dec 26, 2024
cf51bfe
fix: Fix console.log function reference and rename file for consistency
ltfschoen Dec 26, 2024
d15eec4
refactor: Renamce deploy.ts to config.ts
ltfschoen Dec 26, 2024
ee238fd
feat: Combine uploadAndInstantiateGateway. Add bash scripts for end t…
ltfschoen Dec 26, 2024
bf8c8b4
wip: Add script for end to end
ltfschoen Dec 26, 2024
65537b5
wip: Permission denied error in script
ltfschoen Dec 27, 2024
92da978
feat: Quick start. Run it all using docker and systemctl with ./scrip…
ltfschoen Dec 27, 2024
60e692e
docs: Remote editing
ltfschoen Dec 27, 2024
11ee9d8
refactor: Combine upload and instantiate Nunya. Initial pseudo to dec…
ltfschoen Dec 28, 2024
f46e23e
wip: Modify config.ts to be updatable and change code to update it. T…
ltfschoen Dec 29, 2024
ef364e8
feat: Automated deployment config output to deployed.json with Relaye…
ltfschoen Dec 29, 2024
deaf080
wip
ltfschoen Dec 29, 2024
5a4ce61
fix: Fix path to script
ltfschoen Dec 29, 2024
1337597
fix: Tweaks to update relayer config
ltfschoen Dec 29, 2024
4d32f1a
fix: Fix set-relayer
ltfschoen Dec 29, 2024
0bf330b
fix: Fix to correct folder
ltfschoen Dec 29, 2024
fdce0f4
feat: Finish e2e automation to generate deployed YML file of deployed…
ltfschoen Dec 30, 2024
2291807
fix: Fix incorrectly assigned variable
ltfschoen Dec 30, 2024
4210968
fix
ltfschoen Dec 30, 2024
cb98c07
refactor: Improve configuration of environmental variables and use of…
ltfschoen Jan 1, 2025
137a8e7
Integrated Relayer as a Gitsubmodule. Updated quickstart guide
ltfschoen Jan 2, 2025
6211074
wip: Refactor broken. nunya wasm Error during static Wasm validation:…
ltfschoen Jan 2, 2025
5a399b9
fixed
ltfschoen Jan 2, 2025
2bf95f8
omit ip address
ltfschoen Jan 2, 2025
cad78e3
update Relayer Git Submodule commit being used
ltfschoen Jan 2, 2025
59e6248
update Relayer Git Submodule commit being used
ltfschoen Jan 2, 2025
e0cf0d5
lint: fix linting errors in CI
ltfschoen Jan 3, 2025
92ef298
lint: Fix lint error
ltfschoen Jan 3, 2025
04d84ec
chore: Add FIXME for nextjs ts errors
ltfschoen Jan 3, 2025
9cdc5a5
frontend placeholder to test existing submitRetrievePubkey functionality
ltfschoen Jan 3, 2025
ec1f5bb
chore: Reduce logs
ltfschoen Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ node_modules
# cli
dist

# logs
logs/
ethlocal.service.log
secret.service.log
secret-docker.log
relayer.service.log
run.log

**/node_modules/
**/yarn-error.log
Expand All @@ -31,11 +37,14 @@ logs/
.nx/cache
tsconfig.tsbuildinfo
.env
packages/secret-upload-contract/.env
packages/secret-contracts-scripts/.env
packages/secret-instantiate-contract/.env

## ignore different deployments while we are in dev (comment this once contracts stable)
packages/nextjs/contracts/deployedContracts.ts

## NB hardhat ignores are in packages/hardhat/.gitignore

# yq files
yq.1
install-man-page.sh
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "relayer"]
path = packages/relayer/SecretPath
url = [email protected]:ltfschoen/SecretPath.git
branch = nunya
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.2.2.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ nmHoistingLimits: workspaces

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.5.3.cjs
2 changes: 0 additions & 2 deletions _DEMO_AND_VIDEO.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@
* Video of Nunya.business compile, upload, and instantiate a SecretPath Public Gateway Contract to Sepolia Ethereum Testnet.
[YouTube Link](https://youtu.be/O0unCWsrKA4)
* It successfully also deploys NunyaBusiness contract since we added `secretContract = IGateway(gateway);` to use an interface based on Gateway.sol instead of the old DummyGatewayContract interface file.
* Note: The Gateway was deployed with tx: 0x848763e137d97ea53000f360fa27db943f47a13e4e03982320d72dec33478e36 to address 0x41E52332e76988AFBc38280583a7A02492177C65
* Note: The NunyaContract was deployed with tx:

* Video of Nunya.business frontend integration [video](./assets/demo.mp4)
36 changes: 36 additions & 0 deletions _MAINTAINER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Maintainer Only

Note applicable if you do not maintain the repository.

### Setup Github SSH Keys
* Generate Github SSH keys on remote machine. Copy the output to Github SSH Keys https://github.com/settings/keys
```bash
apt-get install -y xclip && \
ssh-keygen -y -t rsa -f ~/.ssh/id_rsa -P "" && \
cat ~/.ssh/id_rsa.pub
```

### Remove Gitsubmodule

* Remove submodule from ./.git/config
* Other changes
```bash
git rm -r --cached ./packages/relayer
rm -rf ./.git/modules/
rm -rf ./packages/relayer/
rm ./.gitmodules
git restore --staged .gitmodules
git ls-files --stage | grep 160000
```

### Setup Gitsubmodule

* Note: The path argument must match the output of `git ls-files --stage | grep 160000`, and it should include the repository name at the end

```bash
git config --local --add checkout.defaultRemote origin
git config status.submodulesummary 1
git submodule add -b nunya --name relayer -- [email protected]:ltfschoen/SecretPath.git packages/relayer/SecretPath
git submodule status
git ls-files --stage | grep 160000
```
500 changes: 359 additions & 141 deletions _SETUP.md

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions _UNSORTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
## Unsorted

The below is unfinished work that may not be necessary anymore.

### WIP - SecretCLI <a id="run-secret-cli"></a>

Enter Secret Development Docker container to interact manually with SecretCLI:

```bash
docker exec -it secretdev /bin/bash
secretcli --help
secretcli keys list
ls /root/.secretd/config
```

* IGNORE - Transfer some Localhost Ethereum tokens from a default account like `Account #0` that is shown when running Ethereum Localhost to an Ethereum wallet address associated with the private key `ETH_DEVELOPMENT_PRIVATE_KEY`.
```
Account #0: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 (10000 ETH)
privateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
```

* TODO - is this necessary? why not just use the default account?

* Transfer some Localhost Secret tokens from a default account that is shown when running Secret Localhost (e.g. secret1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03) to that Secret wallet address (e.g. secret1glfedwlusunwly7q05umghzwl6nf2vj6wr38fg).
* Reference: https://docs.scrt.network/secret-network-documentation/infrastructure/secret-cli/configuration

```
docker exec -it secretdev /bin/bash
secretcli config view
secretcli config set client node tcp://localhost:26657
secretcli config set client chain-id secretdev-1
secretcli config set client output json
secretcli config set client keyring-backend test
secretcli config view client --output-format json
secretcli config home

secretcli query bank balances secret1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03 | jq
secretcli query bank balances secret1glfedwlusunwly7q05umghzwl6nf2vj6wr38fg | jq
```
* Note: Configuration is stored in /root/.secretd/config/client.toml
* Note: `keyring-backend` is where the keys are stored from possible options including: (os|file|kwallet|pass|test|memory)
* Note: We need the 300000uscrt to process the broadcast the `submitRequestValue` transaction from the relayer, so give them more than that.
* Note: If you forget to do this before running the relayer, then you might get error `[SCRT Interface: ERROR] Failed to fetch account info: HTTP 404`
```
secretcli tx bank send secret1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03 secret1glfedwlusunwly7q05umghzwl6nf2vj6wr38fg 100000000000000000uscrt -y

secretcli query bank balances secret1glfedwlusunwly7q05umghzwl6nf2vj6wr38fg | jq
```

* Note: This is necessary because the default account only has a mnemonic phrase, not a private key.

* IGNORE
```
a_mnemonic="grant rice replace explain federal release fix clever romance raise often wild taxi quarter soccer fiber love must tape steak together observe swap guitar"
echo $a_mnemonic | secretcli keys add account --recover
secretcli keys show account

# it should output `secret1ap26qrlp8mcq2pg6r47w43l0y8zkqm8a450s03`

b_mnemonic="jelly shadow frog dirt dragon use armed praise universe win jungle close inmate rain oil canvas beauty pioneer chef soccer icon dizzy thunder meadow"
echo $b_mnemonic | secretcli keys add account2 --recover
secretcli keys show account2

# it should output `secret1fc3fzy78ttp0lwuujw7e52rhspxn8uj52zfyne`

custom_mnemonic="<INSERT_MNEMONIC_PHRASE>"
echo $custom_mnemonic | secretcli keys add custom --hd-path="m/44'/60'/0'/0" --recover
secretcli keys show custom
```

* IGNORE
* TODO - why doesn't the wallet address recovered with `custom_mnemonic` match the one that was generated with MyCrypto when recovering it with that mnemonic phrase? is it possible to recover with the private key instead so it recovers the correct wallet address?
* Note: Used `m/44'/60'/0'/0` since that was the default HD path chosen when generating the wallet in MyCrypto for use with Metamask that uses BIP44 derivation, where the HD path is defined as `m / purpose' / coin_type' / account' / change / address_index`
References:
* https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
* https://ethereum.stackexchange.com/questions/19055/what-is-the-difference-between-m-44-60-0-0-and-m-44-60-0
* Note: The `coin_type` is `529` for Secret Network by default, but we generated it using MyCrypto for Ether, which is `60`
References:
* https://help.keplr.app/articles/how-to-set-a-custom-derivation-path
* TODO
* https://github.com/scrtlabs/SecretNetwork/issues/1690
* https://github.com/scrtlabs/SecretNetwork/issues/1689
59 changes: 59 additions & 0 deletions deployed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"data": {
"relayer": {
"path": "/root/nunya/packages/relayer"
},
"evm": {
"network": "localhost",
"localhost": {
"chainId": "31337",
"endpoint": "http://127.0.0.1:8545",
"nunyaBusinessContractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"gatewayContractAddress": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
},
"sepolia": {
"chainId": "11155111",
"endpoint": "",
"nunyaBusinessContractAddress": "0xAFFF311821C3F3AF863C7103BB17BDC1Ba04603D",
"gatewayContractAddress": "0x1E4B12A9F82b33DA1127B27861EFf5E652de7a6F"
}
},
"secret": {
"network": "localhost",
"testnet": {
"chainId": "",
"endpoint": "",
"secretNunya": {
"nunyaContractCodeId": "",
"nunyaContractCodeHash": "",
"nunyaContractAddress": ""
},
"secretGateway": {
"gatewayContractCodeId": "",
"gatewayContractAddress": "",
"gatewayContractCodeHash": "",
"gatewayContractAdminAddress": "",
"gatewayContractPublicKey": "",
"gatewayContractEncryptionKeyForChaChaPoly1305": ""
}
},
"localhost": {
"chainId": "secretdev-1",
"endpoint": "http://127.0.0.1:1317",
"secretNunya": {
"nunyaContractCodeId": "2",
"nunyaContractCodeHash": "57f4f72804e180100c7108282fc46fa6275bee92829a3faa9e18526c9105948e",
"nunyaContractAddress": "secret1gyruqan6yxf0q423t8z5zce3x7np35uw8s8wqc"
},
"secretGateway": {
"gatewayContractCodeId": "1",
"gatewayContractAddress": "secret1mfk7n6mc2cg6lznujmeckdh4x0a5ezf6hx6y8q",
"gatewayContractCodeHash": "be3db4b4c42d33300eee7801769a4176ed3046f23c08812fc2a85bc76075e1d5",
"gatewayContractAdminAddress": "secret1glfedwlusunwly7q05umghzwl6nf2vj6wr38fg",
"gatewayContractPublicKey": "0x047c4f7a52a10c051639ec0edd3e2d44fef02d993de6b8412273a78ca67f9c10c66069161d67278de0c74c501de435335163d6b7c5a22abae70e49d83a2b3debbd",
"gatewayContractEncryptionKeyForChaChaPoly1305": "A3xPelKhDAUWOewO3T4tRP7wLZk95rhBInOnjKZ/nBDG"
}
}
}
}
}
87 changes: 0 additions & 87 deletions logs/instantiateOutput.log

This file was deleted.

16 changes: 16 additions & 0 deletions logs_secret/deployGatewayEthereumLocalhost.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Generating typings for: 9 artifacts in dir: typechain-types for target: ethers-v6
Successfully generated 20 typings!
Compiled 9 Solidity files successfully (evm target: paris).
network: localhost
chain id: 31337
deployerAddress: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Deployer account balance: 10000.0 ETH
deploying "NunyaBusiness" (tx: 0x932f4c98ac26557cf674d48ae941d2d5d4b402bdf05a2e54ab8f25bbc61ed5c0)...: deployed at 0x5FbDB2315678afecb367f032d93F642f64180aa3 with 2871810 gas
Successfully deployed NunyaBusiness to address: 0x5FbDB2315678afecb367f032d93F642f64180aa3
deploying "Gateway" (tx: 0x21d9641b416d1a45d6d7454155129f258c66ed4dd74276f9494f9d608fa78162)...: deployed at 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 with 3337714 gas
Successfully deployed Gateway to address: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
setGatewayAddressTx tx hash: 0xe87ded4e0e64d7a0872e7120a2cea2e1be91190d7ac1d762f6e0d13e69aa4caf
👋 Nunya contract: 0x5FbDB2315678afecb367f032d93F642f64180aa3
NunyaBusiness balance: 0.000500000000021
Gateway balance: 0.000099999999979
📝 Updated TypeScript contract definition file on ../nextjs/contracts/deployedContracts.ts
16 changes: 16 additions & 0 deletions logs_secret/deployGatewayEthereumSepolia.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Generating typings for: 9 artifacts in dir: typechain-types for target: ethers-v6
Successfully generated 20 typings!
Compiled 9 Solidity files successfully (evm target: paris).
network: sepolia
chain id: 11155111
hre.network.name: sepolia
deployerAddress: 0x83De04f1aad8ABF1883166B14A29c084b7B8AB59
Deployer account balance: 6.938448757518362804 ETH
deploying "NunyaBusiness" (tx: 0x95ce8c146374df85ce0f0f5425e65a2e33092a74b972495c005fa038fe094d33)...: deployed at 0xAFFF311821C3F3AF863C7103BB17BDC1Ba04603D with 2871810 gas
Successfully deployed NunyaBusiness to address: 0xAFFF311821C3F3AF863C7103BB17BDC1Ba04603D
deploying "Gateway" (tx: 0x0c5c2b097801afec5518d3714095569b7df2a53dcde0802c192d036dbd95a66a)...: deployed at 0x1E4B12A9F82b33DA1127B27861EFf5E652de7a6F with 3337833 gas
Successfully deployed Gateway to address: 0x1E4B12A9F82b33DA1127B27861EFf5E652de7a6F
setGatewayAddressTx tx hash: 0xefc300507bbddb3ca95dc178d95b857a3771fd0a0334626f036edfe6ffda4343
👋 Nunya contract: 0xAFFF311821C3F3AF863C7103BB17BDC1Ba04603D
NunyaBusiness balance: 0.0005
Gateway balance: 0.0
Loading
Loading