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

Ft/market mint for #23

Open
wants to merge 498 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
498 commits
Select commit Hold shift + click to select a range
8925b76
update royalty offering & vrfdkg
ducphamle2 Oct 4, 2021
0f1cee5
update vrf dkg
ducphamle2 Oct 5, 2021
136ee39
update vrf flow
piggy2303 Oct 5, 2021
74c8fda
update pagination queries for storage
piggy2303 Oct 6, 2021
faa2dd4
update vrf health check & vrf dkg
piggy2303 Oct 6, 2021
e2c1c82
add gen typescript from schema
piggy2303 Oct 7, 2021
e9f4cf9
fix schema
piggy2303 Oct 7, 2021
372b340
update ai royalty storage & vrf check health
piggy2303 Oct 7, 2021
0ffa12b
add try catch
piggy2303 Oct 7, 2021
953a923
update env test
piggy2303 Oct 7, 2021
bd3c51b
update auction & add decay creator royalty
piggy2303 Oct 8, 2021
f3d8d30
update first lv royalty to work with ow1155
piggy2303 Oct 9, 2021
953cb22
revert first level royalty
piggy2303 Oct 10, 2021
386f6a6
update readme
piggy2303 Oct 11, 2021
d353740
add verify round & check auction buyout
piggy2303 Oct 11, 2021
99b9e6c
update vrf
piggy2303 Oct 11, 2021
3d34c5b
update build vrf
piggy2303 Oct 11, 2021
08cb01c
update build vrf
piggy2303 Oct 11, 2021
5eddd87
add config prod & testnet
piggy2303 Oct 11, 2021
6da01d0
update gitignore and ping interval
piggy2303 Oct 11, 2021
b2895fc
add attr action for execute requests
piggy2303 Oct 11, 2021
41c28dd
refractor blsdkg_js
piggy2303 Oct 12, 2021
fa76deb
update royalty percent to decimal & blsdkg client
piggy2303 Oct 12, 2021
0a2f800
update contract prod & add logs
piggy2303 Oct 12, 2021
2d92bc7
add test send gift & update max royalty marketplace
piggy2303 Oct 15, 2021
cffacdb
uncomment add ping blsdkg
piggy2303 Oct 15, 2021
0d5adbc
update market datahub prevent mint more
piggy2303 Oct 18, 2021
5a4fb72
remove old smart contracts
piggy2303 Oct 19, 2021
32ae1ae
init 1155 marketplace for airight
piggy2303 Oct 19, 2021
e105ffc
update query marketplace & allow change creator 1155 datahub
piggy2303 Oct 20, 2021
7842c8b
update sell & buy 1155
piggy2303 Oct 20, 2021
6ade645
update test royalty 1155
piggy2303 Oct 20, 2021
d4eb289
add auction 1155
piggy2303 Oct 21, 2021
87bebe5
add value to co owners when mint
thinb-orai Oct 22, 2021
fce90b5
update send valey to co-owner when mint
thinb-orai Oct 22, 2021
6b77b68
update send valey to co-owner when mint
thinb-orai Oct 22, 2021
06b431b
update market 1155 auction and add attr royalty
piggy2303 Oct 22, 2021
105c8a6
add test case for claim winner 1155 market
piggy2303 Oct 23, 2021
9ad57a7
add test cases market 1155 bid nft
piggy2303 Oct 25, 2021
eece1d8
fix bug 1155 implementation
piggy2303 Oct 25, 2021
50d48dc
update generic query storage 1155 market
piggy2303 Oct 25, 2021
39e8000
refactor market base query
piggy2303 Oct 25, 2021
00c6d65
update default auction time to timestamp & fix max fee
piggy2303 Oct 26, 2021
2f5325e
refactor datahub market sell
thinb-orai Oct 26, 2021
1890095
remove approve transaction in datahub market sell
thinb-orai Oct 26, 2021
9b12a92
fix bid nft add per price
piggy2303 Oct 26, 2021
ca23470
Merge pull request #1 from oraichain/feature/send-to-coowner-when-mint
ducphamle2 Oct 26, 2021
662e53e
change request_annotation: not change nft to market anymore, allow ma…
thinb-orai Oct 27, 2021
2573bfd
Merge pull request #2 from oraichain/feature/refactor-request-annotation
ducphamle2 Oct 27, 2021
02a06fe
init market multiple creator template
piggy2303 Oct 27, 2021
a7919b4
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Oct 27, 2021
71dc01d
add multisig wallet
tubackkhoa Oct 27, 2021
66fc71a
add multisig wallet
tubackkhoa Oct 27, 2021
a66fd88
update market multiple creators
piggy2303 Oct 27, 2021
8c7ce67
fix empty cosmos msg market multiple creator
piggy2303 Oct 27, 2021
f0bca22
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Oct 27, 2021
cae7401
update multi creator template & 1155 impl verify sell auction
piggy2303 Oct 28, 2021
054e517
optimize multi creator & fix seller (asker) 1155 implementation
piggy2303 Oct 28, 2021
0031c1b
bulk create annotation job
thinb-orai Oct 29, 2021
9b2edab
update optimize to install binaryen
hanhph-orai Oct 29, 2021
18484e8
add approval storage
piggy2303 Oct 29, 2021
9607a89
Merge pull request #3 from oraichain/feature/bulk-create-annotation-job
ducphamle2 Oct 29, 2021
b0cb04a
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Oct 29, 2021
9d3aded
resolve conflict
hanhph-orai Oct 29, 2021
70741e1
Merge branch 'master' of https://github.com/oraichain/oraiwasm
hanhph-orai Oct 29, 2021
40bad22
update flex multisig
tubackkhoa Nov 1, 2021
5f6ee19
Merge branch 'master' of https://github.com/oraichain/oraiwasm
tubackkhoa Nov 1, 2021
9f3cbcc
add docs
tubackkhoa Nov 1, 2021
b0d9a20
update doc for vrfdkg
tubackkhoa Nov 1, 2021
cb9843e
update doc for vrfdkg
tubackkhoa Nov 1, 2021
adfc364
update doc for vrfdkg
tubackkhoa Nov 1, 2021
053d43e
update doc for vrfdkg
tubackkhoa Nov 1, 2021
493dbd9
update doc for vrfdkg
tubackkhoa Nov 1, 2021
2e49f6b
update doc for vrfdkg
tubackkhoa Nov 1, 2021
d76db88
update blacklist 1155
piggy2303 Nov 1, 2021
d366727
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Nov 1, 2021
e109cf2
add more rights to owner nft 721 & 1155
piggy2303 Nov 1, 2021
835733a
add whitelist storage for nft
piggy2303 Nov 1, 2021
2d9f775
add test cases whitelist storage
piggy2303 Nov 2, 2021
6ef5079
update rejected storage remove owner
piggy2303 Nov 2, 2021
93945f7
add filter whitelist market 1155
piggy2303 Nov 2, 2021
9012b54
add event royalty market 1155
piggy2303 Nov 2, 2021
0307653
refactor pay royalties 1155 market
piggy2303 Nov 2, 2021
d5a77b4
change minter to same format 721
piggy2303 Nov 2, 2021
b79dc0d
update event royalties
piggy2303 Nov 3, 2021
d0eb232
refactor pay royalties 1155 market
piggy2303 Nov 4, 2021
b2b9a2b
Add transfer nft directly to market 1155 implementation
vjtc0n Nov 4, 2021
13e0b6b
Remove unused code
vjtc0n Nov 5, 2021
e4e920f
add change owner cw1155
piggy2303 Nov 5, 2021
201522d
change event change owner
piggy2303 Nov 5, 2021
4a224c9
update market datahub implementation
thinb-orai Nov 10, 2021
f0ebd38
annotation results
thinb-orai Nov 19, 2021
3a0270d
migrate aioracle, refactor market impl, update admin 1155 & add edit …
ducphamle2 Nov 22, 2021
2c3636c
udpate annotation review
thinb-orai Nov 22, 2021
7ddb08a
udpate annotation payout logic
thinb-orai Nov 23, 2021
e812924
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Nov 23, 2021
80bc0d6
update vrf signed signature
piggy2303 Nov 23, 2021
d552ec3
update blsdkg
piggy2303 Nov 25, 2021
022147b
datahub-market-implementation: upload reward
thinb-orai Nov 25, 2021
5f3ff06
update signed eth signature format
piggy2303 Nov 30, 2021
022e9c3
update sign signature
piggy2303 Dec 1, 2021
a6376c2
update blsdkg js new version
piggy2303 Dec 2, 2021
954cf9a
add script to get eth address from a list
piggy2303 Dec 2, 2021
079b26c
add spawn exe file
piggy2303 Dec 6, 2021
8851b60
add download link vrf runner
piggy2303 Dec 6, 2021
5bdf828
update
thinb-orai Dec 14, 2021
653edf9
update
thinb-orai Dec 14, 2021
e6784c8
update
piggy2303 Dec 15, 2021
ef47f2b
udpate airight market
thinb-orai Dec 15, 2021
7b808d8
udpate datahub implementation
thinb-orai Dec 15, 2021
2947b89
Merge pull request #5 from oraichain/feature/update-datahub-implement…
ducphamle2 Dec 15, 2021
9cc91a0
Co-authored-by: Pham Thanh Tu <[email protected]>
ducphamle2 Dec 15, 2021
05a1f24
update package
piggy2303 Dec 16, 2021
432eaed
remove leveldb
piggy2303 Dec 16, 2021
2d7d281
Merge branch 'feature/update-airight-market' of https://github.com/or…
ducphamle2 Dec 21, 2021
12244cd
update market impl for 721
ducphamle2 Dec 21, 2021
d9a2b0c
add test functions for backward comp market
ducphamle2 Dec 21, 2021
1796626
update market impl airight & add vrf solana
ducphamle2 Dec 26, 2021
0bbcd60
Merge pull request #4 from oraichain/feature/update-airight-market
ducphamle2 Dec 26, 2021
4544e5d
update solana bridge
ducphamle2 Dec 28, 2021
fb7a8c1
add solana list & update market impl
ducphamle2 Dec 28, 2021
b929f96
update royalty formula & add approve 721 market
ducphamle2 Dec 30, 2021
b00da66
Merge pull request #6 from oraichain/feature/update-airight-market
ducphamle2 Jan 4, 2022
6e32742
finish aioracle v2 with pricefeed demo
ducphamle2 Jan 5, 2022
d7f7d0e
refactor price scripts
ducphamle2 Feb 8, 2022
0a11d36
remove redundant code oscript price
ducphamle2 Feb 8, 2022
86b1639
airight nft staking
thinb-orai Feb 8, 2022
71acdec
init oscript & tcase flower classification
ducphamle2 Feb 8, 2022
6010037
airight nft staking: create collection pool info
thinb-orai Feb 9, 2022
02e548f
update testcase flower classification flow
ducphamle2 Feb 10, 2022
7b71a96
airight nft staking: update
thinb-orai Feb 10, 2022
d591d6a
add query service fees
ducphamle2 Feb 11, 2022
1aa8954
airight nft staking: testing
thinb-orai Feb 11, 2022
a60cab8
airight nft staking: withdraw and claim
thi-nb Feb 13, 2022
bc884ec
airight nft staking: testing for claim and withdraw
thinb-orai Feb 14, 2022
9ec91e7
airight nft staking: testing for claim and withdraw
thinb-orai Feb 14, 2022
c8f2b2d
airight nft staking: allow admin to reset total earned
thinb-orai Feb 15, 2022
4c90d36
airight nft staking: allow admin to reset total earned
thinb-orai Feb 15, 2022
ec402c7
add manual update checkpoint when needed
ducphamle2 Feb 17, 2022
a5d6e47
set expired block to collection pool and allow user to choose withdra…
thinb-orai Feb 18, 2022
7a48f5b
get mutiple collection pool infos
thinb-orai Feb 18, 2022
b14a74a
airight nft staking: get real acc_per_share when query get collection…
thi-nb Feb 20, 2022
9db931f
update
thinb-orai Feb 22, 2022
0f6e1bf
fix runtime error
thi-nb Feb 22, 2022
224df7f
nft_staking: whitelist for ow1155 and ow721
thi-nb Feb 27, 2022
73c6f1a
nft_staking: update admin
thinb-orai Feb 28, 2022
28daa77
Merge pull request #7 from oraichain/feature/airight-nft-staking
ducphamle2 Feb 28, 2022
8409b5c
add migrate ow1155
ducphamle2 Mar 2, 2022
dc6b5a1
Merge branch 'update/aioracle-v2-serivces' of https://github.com/orai…
ducphamle2 Mar 2, 2022
a92d34d
add migrate msg ow1155
ducphamle2 Mar 3, 2022
5ef10bd
fix executor structure
ducphamle2 Mar 4, 2022
94a8e8d
update executor claim rewards
ducphamle2 Mar 8, 2022
d0e896a
add trusting pool mechanism & fix query fee bug aioracle
ducphamle2 Mar 8, 2022
d19bac7
add query maximum executor fee
ducphamle2 Mar 9, 2022
1839c69
rename reward pool & add pool response data
ducphamle2 Mar 9, 2022
d199dc6
rework trusting pool
ducphamle2 Mar 9, 2022
f977366
add new aioracle health check & update executor fee scheme
ducphamle2 Mar 11, 2022
01087e5
fix empty sent funds bug
ducphamle2 Mar 18, 2022
fea054e
fix default executor fee
ducphamle2 Mar 18, 2022
6b00cdb
update checkpoint & interval aioracle ping
ducphamle2 Mar 21, 2022
650c05f
update query executor response
ducphamle2 Mar 22, 2022
8f1ce2a
update claim reward scheme ping
ducphamle2 Mar 23, 2022
cfa1091
clean aioracle dir remove old code
ducphamle2 Mar 24, 2022
e1bbef9
update index for executors
ducphamle2 Mar 25, 2022
714515f
add test case for new executor struct
ducphamle2 Mar 27, 2022
a1208e2
update executor query & fix health check
ducphamle2 Mar 28, 2022
5aca7bd
temp finish market 721 impl support dif currency
ducphamle2 Apr 6, 2022
d6e4235
fix token id & royalty event format
ducphamle2 Apr 7, 2022
eb17101
add max decimal point market impl
ducphamle2 Apr 7, 2022
e6cfe83
add migrate marketplace, update 1155 market & fix some bugs
ducphamle2 Apr 7, 2022
0d268e9
update test cases market 1155
ducphamle2 Apr 8, 2022
a6aa17f
comment test case & add new chain
ducphamle2 Apr 12, 2022
6f5be67
add snake slash for amount event royalty
ducphamle2 Apr 13, 2022
2d08517
update new vrf contract testnet
piggy2303 Apr 14, 2022
2be55fd
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Apr 14, 2022
ff1a361
add market payment storage
ducphamle2 Apr 15, 2022
1192339
fix payment storage & finish market 721 impl
ducphamle2 Apr 15, 2022
8c5a2ca
finish market payment storage
ducphamle2 Apr 15, 2022
da34cf8
update default denom market payment
ducphamle2 Apr 15, 2022
52eac42
fix payment 1155 bug & add query ranges
ducphamle2 Apr 15, 2022
dfb9c03
fix parse payment key market payment storage
ducphamle2 Apr 18, 2022
bd21cfa
update aioracle health check
ducphamle2 Apr 26, 2022
d93028f
add prev owner in royalty list
ducphamle2 Apr 27, 2022
8194ece
fix prev royalty bug
ducphamle2 Apr 27, 2022
240016a
Merge pull request #8 from oraichain/update/airight-marketplace
ducphamle2 May 4, 2022
8c390c1
Merge pull request #9 from oraichain/update/aioracle-v2-serivces
ducphamle2 May 4, 2022
cc948c8
ow20 multi transfer
duyhung2201 May 5, 2022
66420a2
update ow20 contract migration
ducphamle2 May 9, 2022
bc51ff3
refactor code, add join & leave executor
ducphamle2 May 9, 2022
cf9459d
downgrade edition cargo to 2018
ducphamle2 May 10, 2022
2c612e3
Update function and testcase for ai executor join and leave
duongtd1998 May 13, 2022
5c6e2af
refactor & add contract fees
ducphamle2 May 16, 2022
2e13140
Merge branch 'update/refactor-aioracle' of https://github.com/oraicha…
ducphamle2 May 16, 2022
65be10b
uncomment migrate func & add init contract fee
ducphamle2 May 16, 2022
6642e3c
fix unique constraint bug index
ducphamle2 May 16, 2022
e7a2ff8
Merge branch 'update/refactor-aioracle'
ducphamle2 May 16, 2022
ae3344f
Update msg migrate contract on ide
duongtd1998 May 18, 2022
cd4b414
Add market fee query and test case for it
duongtd1998 May 19, 2022
277b7b3
Update market fee variable when testing
duongtd1998 May 19, 2022
585fe42
refactor check funds
ducphamle2 May 20, 2022
03f5337
Refactor funds param on try_buy and try_bid market 1155
duongtd1998 May 20, 2022
9b8173e
Merge pull request #10 from oraichain/feat/AddMarketFeeQuery
ducphamle2 May 24, 2022
7a040d2
update init market fee when migrate
ducphamle2 May 24, 2022
5cf02ea
ow20 merkle airdrop
duyhung2201 May 25, 2022
44ae165
ow20-merkle-airdrop
duyhung2201 May 26, 2022
29fcee2
update tutorial link
hoangdv2429 May 28, 2022
9e15ed1
update cosmwasm docker & market airight
ducphamle2 May 29, 2022
59386eb
Merge branch 'master' of https://github.com/oraichain/oraiwasm
ducphamle2 May 29, 2022
9f36944
fix owner to null bug update config merkle airdrop
ducphamle2 May 29, 2022
7bc1bcd
Merge pull request #11 from hoangdv2429/master
ducphamle2 May 31, 2022
1e96e2b
merkle airdrop stage metadata
duyhung2201 Jun 7, 2022
376464d
update ow20 merkle airdrop
ducphamle2 Jun 7, 2022
bb68db0
update merkle airdrop & add basic oscript
ducphamle2 Jun 11, 2022
34efea9
fix executor join bug
ducphamle2 Jul 4, 2022
a1bbde5
Create .gitpod.yml
ducphamle2 Aug 3, 2022
ecb0a27
Update .gitpod.yml
ducphamle2 Aug 5, 2022
89c5e4d
fix: change ge to gt for try-payout
im6h Aug 9, 2022
4da2e38
fix: allow reviewer update their result that commited
im6h Aug 9, 2022
aa0ae15
update review result
tuanorai Aug 9, 2022
da78f12
update optimize
tubackkhoa Aug 15, 2022
1b0f42d
Update validate transfer nft direct & test
duongtd1998 Aug 18, 2022
409336e
Merge pull request #12 from oraichain/fix/market-datahub-trypayout
im6h Aug 18, 2022
063c335
add change minter cw20
ducphamle2 Aug 22, 2022
b883f82
Merge pull request #14 from oraichain/feat/change-minter-cw20
ducphamle2 Aug 22, 2022
ce84f97
merkle airdrop query claim keys
duyhung2201 Jul 16, 2022
69fc37f
airdrop: get claim key count
duyhung2201 Jul 16, 2022
9b5d449
airdrop: update claim
duyhung2201 Jul 16, 2022
97e8c98
Merge pull request #13 from oraichain/feature/merkle-airdrop
ducphamle2 Aug 23, 2022
e4af31b
fix: data invalid type when parse string input
im6h Aug 28, 2022
bb0a760
dino ai market basic logic smc + test
tuanorai Sep 18, 2022
a854354
fix: remove redundant dangerous code from ow20
ducphamle2 Sep 20, 2022
5d545b5
fix: remove send native
ducphamle2 Sep 20, 2022
8126758
Merge pull request #16 from oraichain/duc/fix-cw20-bug
ducphamle2 Sep 20, 2022
ed76777
optimize market_datahub_ai_marketplace contract
tubackkhoa Sep 23, 2022
4b115ce
update: refactor sign sig data field
ducphamle2 Oct 12, 2022
750471c
Merge pull request #19 from oraichain/duc/refactor-vrfjs
ducphamle2 Oct 13, 2022
08180b8
Merge pull request #17 from oraichain/feature/dino-ai-market
tubackkhoa Oct 14, 2022
18db978
Merge pull request #15 from oraichain/fix/oscript_flower_classisifcation
tubackkhoa Oct 14, 2022
b2fad66
fixed human addr unwrap or error market impl
ducphamle2 Jan 19, 2023
c30f1d9
fixed empty key error prev owner market impl
ducphamle2 Jan 19, 2023
6ce37fc
add: market1155 mintfor; remove: warning
meomeocoj Aug 1, 2023
5ed3df0
add: update and query admin market_1155_implementation
meomeocoj Aug 7, 2023
89b4a33
add: BuyMsg params buyer
meomeocoj Aug 7, 2023
3f6300a
update schema
tubackkhoa Aug 7, 2023
8e94f2f
update schema
tubackkhoa Aug 7, 2023
b284338
add: Pulling state from on-chain, add test mint_for, buy_for
meomeocoj Aug 9, 2023
99126aa
merge: conflict
meomeocoj Aug 9, 2023
a1e3ee4
update: test pull code from chain
meomeocoj Aug 10, 2023
e4780a8
add: test:ci, complete:test market_buy_for
meomeocoj Aug 10, 2023
7f9710e
update script
meomeocoj Sep 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ Cargo.lock
**/*.wasm
**/*.txt
*.log
.DS_Store
.registry_cache
node_modules
.env*
.DS_Store

.registry_cache
7 changes: 7 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
image: orai/cosmwasm-gitpod:0.11.7
workspaceLocation: '.'

vscode:
extensions:
- matklad.rust-analyzer
- oraichain.cosmwasm-ide
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rust-analyzer.runnables.command": "env RUST_TEST_THREADS=1 cargo -q"
}
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]

members = [
"package/*/*",
]
resolver = "2"

members = ["package/*/*"]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ docker-compose exec app bash
# build a smart contract, second param is schema option
./optimize.sh package/price/datasource_eth true

# if need customize std, using this command
cargo install xargo

# run test a function
cargo test --lib -p nft -- --exact contract::tests::query_tokens_by_owner --show-output

Expand All @@ -42,4 +45,4 @@ Inside the remote container window, you can freely install extensions for Rust.

## Handling smart contracts

The detailed tutorials for the smart contracts are located [here](./smart-contracts/README.md#Create-a-new-Oraichain-smart-contract-tutorial)
The detailed tutorials for the smart contracts are located [here](https://oraiwasm.web.app/)
87 changes: 87 additions & 0 deletions deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm-stargate");
const { DirectSecp256k1HdWallet } = require("@cosmjs/proto-signing");
const {
GasPrice,
makeCosmoshubPath,
calculateFee,
} = require("@cosmjs/stargate");
const path = require("path");
const fs = require("fs");

const config = {
networks: {
oraichain_testnet: {
rpc: "https://testnet-rpc.orai.io",
chainId: "Oraichain-testnet",
denom: "orai",
prefix: "orai",
gasPrice: "0.024orai",
},
oraichain: {
rpc: " https://rpc.orai.io",
chainId: "Oraichain",
denom: "orai",
prefix: "orai",
gasPrice: "0.024orai",
},
},
};

require("dotenv").config();

async function setUp() {
const argv = process.argv;
const package = argv[2];
const wasmPath = path.resolve(__dirname, package);
const initMsgPath = argv[3];
const initMsgResolvePath = path.resolve(__dirname, initMsgPath);

const network =
process.env.NODE_ENV === "production"
? config.networks.oraichain
: config.networks.oraichain_testnet;
const mnemonic = process.env.MNEMONIC;
const hdPaths = [makeCosmoshubPath(0)];
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
prefix: network.prefix,
hdPaths,
});
const [signer] = await wallet.getAccounts();

const cc = await SigningCosmWasmClient.connectWithSigner(
network.rpc,
wallet,
{
prefix: network.prefix,
gasPrice: GasPrice.fromString(network.gasPrice),
}
);

const wasm = fs.readFileSync(wasmPath);
const uploadFee = calculateFee(0, GasPrice.fromString(network.gasPrice));
console.log("=>uploadFee", uploadFee);
const uploadResult = await cc.upload(signer.address, wasm, "auto");
console.log("==>Codeid", uploadResult.codeId);

const initMsg = JSON.parse(fs.readFileSync(initMsgResolvePath));

const response = await cc.instantiate(
signer.address,
uploadResult.codeId,
initMsg,
"orai_market_1155_implementation",
"auto",
{ admin: signer.address }
);

console.log(response.contractAddress);
}

setUp()
.then((_result) => {
process.exit(1);
})
.catch((err) => {
console.log(err);
process.exit(1);
});
9 changes: 0 additions & 9 deletions docker-compose.yml

This file was deleted.

47 changes: 0 additions & 47 deletions optimize.sh

This file was deleted.

Loading