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

Feature: provide audit zcnswap and refactor if needed #1205

Merged
merged 41 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ec22399
feature: modifies zcnswap to be consitent with zcnbridge
YarikRevich Sep 1, 2023
385b901
fix: fixed bugs
Sep 2, 2023
cb480a5
fix: removed dead code
Sep 3, 2023
92e4c0e
feature: extended key store logic
YarikRevich Sep 8, 2023
5a89bb1
fix: fixed bugs
YarikRevich Sep 9, 2023
4010aa7
Merge branch 'sprint-1.11' into feature/zcnswap
YarikRevich Sep 9, 2023
29e53ac
Merge github.com:0chain/gosdk into sprint-1.11
YarikRevich Sep 9, 2023
b3f7793
Merge branch 'sprint-1.11' of github.com:0chain/gosdk into feature/zc…
YarikRevich Sep 10, 2023
1ae5347
fix: fixed conflicts
YarikRevich Sep 10, 2023
d89dee8
Merge branch 'sprint-1.11' of github.com:0chain/gosdk into sprint-1.11
YarikRevich Sep 10, 2023
9e1c38a
Merge branch 'sprint-1.11' into feature/zcnswap
YarikRevich Sep 10, 2023
6dcf6df
fix: removed dead code
YarikRevich Sep 10, 2023
b9f2e14
fix: fixed bugs
YarikRevich Sep 10, 2023
464260a
Fix/remove path (#1221)
dabasov Sep 13, 2023
6c6e208
Revert "Fix/remove path (#1221)" (#1222)
Kishan-Dhakan Sep 14, 2023
f9dc5b1
remove path header, fix ws tag (#1223)
dabasov Sep 14, 2023
83298fe
Updated self hosted macos runner (#1219)
shahnawaz-creator Sep 12, 2023
26cac5b
Merge branch 'sprint-1.11' of github.com:0chain/gosdk into feature/zc…
YarikRevich Oct 1, 2023
dd4ca43
fix
YarikRevich Oct 1, 2023
2571888
updated wasm binary build fix.
shahnawaz-creator Oct 2, 2023
6a18459
Merge branch 'sprint-1.11' of github.com:0chain/gosdk into feature/zc…
YarikRevich Oct 10, 2023
a867e56
feature: added test case for swap logic
YarikRevich Oct 10, 2023
9c7afa9
fix: resolved dependency conflicts
YarikRevich Oct 10, 2023
ed7c79b
fix: fixed bugs
YarikRevich Oct 11, 2023
f23b10d
Merge branch 'sprint-1.11' of github.com:0chain/gosdk into feature/zc…
YarikRevich Oct 11, 2023
61fc6b6
feature: added zcn eth rate fetch logic
YarikRevich Oct 12, 2023
5b106da
Merge github.com:0chain/gosdk into feature/zcnswap
YarikRevich Oct 12, 2023
9db6af0
Merge branch 'sprint-1.11' of github.com:0chain/gosdk into feature/zc…
YarikRevich Oct 12, 2023
3c29c7c
Update blobber.go
YarikRevich Oct 12, 2023
56d25ef
Update authorizers_query.go
YarikRevich Oct 12, 2023
a9cceef
feature: replaced confusing param naming
YarikRevich Oct 12, 2023
ca67bab
fix: updated bridge initialization in wasm bridge integration
YarikRevich Oct 12, 2023
ccc8369
fix: replaced value amount with correct value
YarikRevich Oct 15, 2023
635ea9d
Merge branch 'sprint-1.11' into feature/zcnswap
YarikRevich Oct 17, 2023
d9465f6
fix: wrong test case values
YarikRevich Oct 17, 2023
b9fb6a4
Merge branch 'feature/zcnswap' of github.com:0chain/gosdk into featur…
YarikRevich Oct 17, 2023
75c6c67
Merge branch 'sprint-1.11' into feature/zcnswap
dabasov Oct 22, 2023
1b9b429
feature: switch to the usage of zcn token smart contract
YarikRevich Oct 26, 2023
f27ef64
Merge branch 'feature/zcnswap' of github.com:0chain/gosdk into featur…
YarikRevich Oct 26, 2023
ff1f773
fix: fixed bridge tests
YarikRevich Oct 26, 2023
fe4847c
Merge branch 'sprint-1.11' into feature/zcnswap
YarikRevich Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ require (
github.com/herumi/bls-go-binary v1.31.0
github.com/influxdata/influxdb v1.8.3
github.com/klauspost/reedsolomon v1.11.7
github.com/labstack/echo v3.3.10+incompatible
github.com/lithammer/shortuuid/v3 v3.0.7
github.com/machinebox/graphql v0.2.2
github.com/magma/augmented-networks/accounting/protos v0.1.1
Expand Down Expand Up @@ -81,7 +80,6 @@ require (
github.com/huin/goupnp v1.0.3 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/matryer/is v1.4.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down Expand Up @@ -111,8 +109,6 @@ require (
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.dedis.ch/fixbuf v1.0.3 // indirect
go.opencensus.io v0.24.0 // indirect
Expand Down
14 changes: 0 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8=
github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts=
Expand All @@ -373,11 +369,9 @@ github.com/magma/augmented-networks/accounting/protos v0.1.1/go.mod h1:Hpfg8aAxl
github.com/matryer/is v1.4.1 h1:55ehd8zaGABKLXQUe2awZ99BD/PTc2ls+KV/dXphgEQ=
github.com/matryer/is v1.4.1/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
Expand Down Expand Up @@ -531,11 +525,6 @@ github.com/uptrace/bunrouter v1.0.20 h1:jNvYNcJxF+lSYBQAaQjnE6I11Zs0m+3M5Ek7fq/T
github.com/uptrace/bunrouter v1.0.20/go.mod h1:TwT7Bc0ztF2Z2q/ZzMuSVkcb/Ig/d3MQeP2cxn3e1hI=
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q=
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
Expand Down Expand Up @@ -745,9 +734,6 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
4 changes: 2 additions & 2 deletions wasmsdk/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ func initBridge(
gasLimit uint64,
value int64,
consensusThreshold float64) error {
wallet := zcncore.GetWalletRaw()
if len(wallet.ClientID) == 0 {
if len(zcncore.GetWalletRaw().ClientID) == 0 {
return errors.New("wallet_error", "wallet is not set")
}

Expand All @@ -49,6 +48,7 @@ func initBridge(
"",
gasLimit,
consensusThreshold,
zcnbridge.BancorAPIURL,
ethereumClient,
transactionProvider,
keyStore,
Expand Down
4 changes: 1 addition & 3 deletions wasmsdk/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@ func main() {
"executeSmartContract": executeSmartContract,
"faucet": faucet,

//swap
"setSwapWallets": setSwapWallets,
"swapToken": swapToken,
// bridge
"initBridge": initBridge,
"burnZCN": burnZCN,
"mintZCN": mintZCN,
Expand Down
26 changes: 0 additions & 26 deletions wasmsdk/swap.go

This file was deleted.