Skip to content

Commit

Permalink
- IBC transfer rewards from ATOM/OSMO liquidity mining back to Frogchain
Browse files Browse the repository at this point in the history
- Return the rewards to FROG stakers as staking rewards (FROG is a bond denom of frogchain)
  • Loading branch information
in-eth committed Jul 25, 2023
1 parent a80e957 commit 4f057e8
Show file tree
Hide file tree
Showing 16 changed files with 179 additions and 896 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ func New(
app.AmmKeeper,
icaControllerKeeper,
*app.IBCKeeper,
app.TransferKeeper,
scopedInvestibcKeeper,
scopedIBCKeeper,
)
Expand Down
45 changes: 24 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.19

require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.0.1
github.com/cometbft/cometbft v0.37.1
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.7.0
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.3
github.com/cosmos/cosmos-sdk v0.47.4
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.1.0
github.com/gogo/protobuf v1.3.2
Expand All @@ -21,23 +21,23 @@ require (
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130
google.golang.org/grpc v1.56.2
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
)

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go v0.110.4 // indirect
cloud.google.com/go/compute v1.20.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.12.0 // indirect
cloud.google.com/go/storage v1.29.0 // indirect
cloud.google.com/go/iam v1.1.0 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.3 // indirect
cosmossdk.io/log v1.1.0 // indirect
cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca // indirect
cosmossdk.io/tools/rosetta v0.2.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -87,9 +87,10 @@ require (
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
Expand All @@ -115,7 +116,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
Expand Down Expand Up @@ -149,15 +150,17 @@ require (
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.110.0 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
Expand Down
56 changes: 56 additions & 0 deletions go.sum

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions network/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ echo "Creating and collecting gentx..."
$BINARY gentx val1 7000000000stake --home $CHAIN_DIR/$CHAINID_1 --chain-id $CHAINID_1 --keyring-backend test
$BINARY collect-gentxs --home $CHAIN_DIR/$CHAINID_1

echo "Creating and collecting gentx..."
export alice=$($BINARY keys show alice -a --home $CHAIN_DIR/$CHAINID_1) && echo $alice;

echo "Changing defaults and ports in app.toml and config.toml files..."
sed -i -e 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2PPORT_1"'"#g' $CHAIN_DIR/$CHAINID_1/config/config.toml
sed -i -e 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPCPORT_1"'"#g' $CHAIN_DIR/$CHAINID_1/config/config.toml
Expand Down
2 changes: 1 addition & 1 deletion osmosis/lockup/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 0 additions & 75 deletions osmosis/pool/codec.go

This file was deleted.

21 changes: 20 additions & 1 deletion osmosis/pool/constants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package types

import (
"math/big"

sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand All @@ -20,9 +22,26 @@ const (
MaxNumOfAssetsInPool = 8
)

const maxBitLen = 256

func NewIntWithDecimal(n int64, dec int) sdk.Int {
if dec < 0 {
panic("NewIntWithDecimal() decimal is negative")
}
exp := new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(dec)), nil)
i := new(big.Int)
i.Mul(big.NewInt(n), exp)

// Check overflow
if i.BitLen() > maxBitLen {
panic("NewIntWithDecimal() out of bound")
}
return sdk.NewIntFromBigInt(i)
}

var (
// OneShare represents the amount of subshares in a single pool share.
OneShare = sdk.NewIntWithDecimal(1, OneShareExponent)
OneShare = NewIntWithDecimal(1, OneShareExponent)

// InitPoolSharesSupply is the amount of new shares to initialize a pool with.
InitPoolSharesSupply = OneShare.MulRaw(100)
Expand Down
Loading

0 comments on commit 4f057e8

Please sign in to comment.