Skip to content

Pre-generated Cosmos SDK and IBC Protobuf Encoder and Decoder for Solidity

License

Notifications You must be signed in to change notification settings

calvinaco/cosmos-protobuf-solidity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosmos Protobuf En/Decoder for Solidity

Pre-generated Cosmos SDK and IBC Protobuf Encoder and Decoder for Solidity.

Content

./generated folder contains pre-generated solidity file based on Cosmos SDK v0.46.15 and ibc-go v6.2.0

Sample Use

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.9;

import "./cosmos/staking/v1beta1/tx.sol";

contract TestEncodeMsgDelegate {
    event EncodedMsg(bytes data);

    constructor() {
        emit EncodedMsg(CosmosStakingV1beta1MsgDelegate.encode(
            CosmosStakingV1beta1MsgDelegate.Data({
                delegator_address: "cro1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                validator_address: "crocncl1yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
                amount: CosmosBaseV1beta1Coin.Data({
                    denom: "basecro",
                    amount: "100"
                })
            })
        ));
    }
}

How to Generate

If you need other versions, you can tweak the ./scripts/update-proto-deps.sh to download your desired version protobuf definitions.

./scripts/update-proto-deps.sh
./scripts/install-protobuf-solidity.sh
SOLPB_DIR=./solidity-protobuf ./scripts/generate-protobuf-solidity.sh

License

Apache 2.0

About

Pre-generated Cosmos SDK and IBC Protobuf Encoder and Decoder for Solidity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published