Skip to content

Commit

Permalink
Merge pull request #13 from CudoVentures/cudos-dev
Browse files Browse the repository at this point in the history
merge cosmos-sdk 0.45.3
  • Loading branch information
kstoykov authored Apr 28, 2022
2 parents e1dedbc + 32f16dd commit 9da8b0b
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 23 deletions.
16 changes: 8 additions & 8 deletions module/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ import (
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
transfer "github.com/cosmos/ibc-go/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/modules/core"
ibcclient "github.com/cosmos/ibc-go/modules/core/02-client"
porttypes "github.com/cosmos/ibc-go/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper"
transfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v2/modules/core"
ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client"
porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper"

// "github.com/osmosis-labs/bech32-ibc/x/bech32ibc"
// bech32ibckeeper "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/keeper"
Expand Down
4 changes: 2 additions & 2 deletions module/app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/modules/core/24-host"
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
)

func init() {
Expand Down
9 changes: 7 additions & 2 deletions module/app/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
sdk "github.com/cosmos/cosmos-sdk/types"
tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"

Expand Down Expand Up @@ -85,10 +86,14 @@ func AppStateRandomizedFn(

// generate a random amount of initial stake coins and a random initial
// number of bonded accounts
var initialStake, numInitiallyBonded int64
var initialStake sdk.Int
var numInitiallyBonded int64
minSelfDeleg := sdk.TokensFromConsensusPower(2000000, sdk.DefaultPowerReduction)
appParams.GetOrGenerate(
cdc, simappparams.StakePerAccount, &initialStake, r,
func(r *rand.Rand) { initialStake = r.Int63n(1e12) },
func(r *rand.Rand) {
initialStake = minSelfDeleg.Add(sdk.NewInt(r.Int63n(10)).Mul(sdk.NewInt(10000000)).Mul(minSelfDeleg))
},
)
appParams.GetOrGenerate(
cdc, simappparams.InitiallyBondedValidators, &numInitiallyBonded, r,
Expand Down
2 changes: 1 addition & 1 deletion module/app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func SimulationOperations(app Gravity, cdc codec.JSONCodec, config simtypes.Conf
Rand: &rand.Rand{},
GenState: map[string]json.RawMessage{},
Accounts: []simtypes.Account{},
InitialStake: 0,
InitialStake: sdk.TokensFromConsensusPower(2000000, sdk.DefaultPowerReduction),
NumBonded: 0,
GenTimestamp: time.Time{},
UnbondTime: 0,
Expand Down
8 changes: 4 additions & 4 deletions module/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.15

// replace github.com/cosmos/cosmos-sdk => ../../cosmos-sdk

replace github.com/cosmos/cosmos-sdk => github.com/CudoVentures/cosmos-sdk v0.0.0-20220421090641-3a0d43edd09b
replace github.com/cosmos/cosmos-sdk => github.com/CudoVentures/cosmos-sdk v0.0.0-20220428091713-7509d08ecf5c

require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/cosmos/cosmos-sdk v0.44.5
github.com/cosmos/ibc-go v1.2.3
github.com/cosmos/cosmos-sdk v0.45.3
github.com/cosmos/ibc-go/v2 v2.2.0
github.com/ethereum/go-ethereum v1.10.3
github.com/gin-gonic/gin v1.7.0 // indirect
github.com/gogo/protobuf v1.3.3
Expand All @@ -28,7 +28,7 @@ require (
github.com/tendermint/tendermint v0.34.19
github.com/tendermint/tm-db v0.6.6
github.com/tklauser/go-sysconf v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb
google.golang.org/grpc v1.45.0
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Expand Down
14 changes: 8 additions & 6 deletions module/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CudoVentures/cosmos-sdk v0.0.0-20220421090641-3a0d43edd09b h1:8nhAsoxkCZD0G4K2Q91TgLFUD8x/W4heUHAjj8zHygw=
github.com/CudoVentures/cosmos-sdk v0.0.0-20220421090641-3a0d43edd09b/go.mod h1:xkaQHdLk55zxd1C2sR6dKh53QVoBW0IWFsKv3nQKwtY=
github.com/CudoVentures/cosmos-sdk v0.0.0-20220428091713-7509d08ecf5c h1:vQ4vksFUif0v7J6SskDi7MCaQbD1Dvfc8MxDt/ajz7A=
github.com/CudoVentures/cosmos-sdk v0.0.0-20220428091713-7509d08ecf5c/go.mod h1:WOqtDxN3eCCmnYLVla10xG7lEXkFjpTaqm2a2WasgCc=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
Expand Down Expand Up @@ -224,8 +224,9 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg=
github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE=
github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8=
github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
github.com/confio/ics23/go v0.7.0 h1:00d2kukk7sPoHWL4zZBZwzxnpA2pec1NPdwbSokJ5w8=
github.com/confio/ics23/go v0.7.0/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ=
github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q=
github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ=
Expand All @@ -250,8 +251,8 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y=
github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w=
github.com/cosmos/ibc-go v1.2.3 h1:+Xdhshvls9c6NQNAj7jz5YUtpqCd7AwadEImpaeVReo=
github.com/cosmos/ibc-go v1.2.3/go.mod h1:TNJMo+fPU4GmpAGxqedjuA1l6izRLGPvuIRLpWAbXuE=
github.com/cosmos/ibc-go/v2 v2.2.0 h1:nqpvElI9ku5oQZtKvLerhZ/UXH7QoL44VBTWwZkS4C8=
github.com/cosmos/ibc-go/v2 v2.2.0/go.mod h1:rAHRlBcRiHPP/JszN+08SJx3pegww9bcVncIb9QLx7I=
github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4=
github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY=
github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI=
Expand Down Expand Up @@ -1597,8 +1598,9 @@ google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ6
google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb h1:ZrsicilzPCS/Xr8qtBZZLpy4P9TYXAfl49ctG1/5tgw=
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
Expand Down
23 changes: 23 additions & 0 deletions solidity/contract-deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios";
import { exit } from "process";
import { start } from "node:repl";
import { SSL_OP_EPHEMERAL_RSA } from "node:constants";
import hre from "hardhat";

const args = commandLineArgs([
// the ethernum node used to deploy the contract
Expand Down Expand Up @@ -241,6 +242,28 @@ async function deploy() {
console.log("Gravity deployed at Address - ", gravity.address);
await submitGravityAddress(gravity.address);

await gravity.deployTransaction.wait(10)
console.log("Verifying contract on Etherscan...");

try {
await hre.run("verify:verify", {
address: gravity.address,
constructorArguments: [
gravityId,
vote_power,
eth_addresses,
powers,
cudosAccessControl
],
});
console.log("Contract is verified")
} catch (err) {
if (err.message.includes("Reason: Already Verified")) {
console.log("Contract is already verified!");
} else {
throw err
}
}
}

function getContractArtifacts(path: string): { bytecode: string; abi: string } {
Expand Down
12 changes: 12 additions & 0 deletions solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import "@nomiclabs/hardhat-waffle";
import "hardhat-gas-reporter";
import "hardhat-typechain";
import { task } from "hardhat/config";
import "@nomiclabs/hardhat-etherscan"


task("accounts", "Prints the list of accounts", async (args, hre) => {
const accounts = await hre.ethers.getSigners();
Expand Down Expand Up @@ -47,7 +49,14 @@ module.exports = {
}
]
},
defaultNetwork: process.env.DEFAULT_NETWORK,
networks: {
rinkeby: {
url: `${process.env.ETH_NODE}`
},
mainnet: {
url: `${process.env.ETH_NODE}`
},
hardhat: {
timeout: 2000000,
accounts: [
Expand Down Expand Up @@ -850,4 +859,7 @@ module.exports = {
mocha: {
timeout: 2000000
},
etherscan:{
apiKey: `${process.env.ETHERSCAN_API_KEY}`
}
};

0 comments on commit 9da8b0b

Please sign in to comment.