-
Notifications
You must be signed in to change notification settings - Fork 1
/
tx.proto
165 lines (136 loc) · 5.62 KB
/
tx.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
syntax = "proto3";
package canto.erc20.v1;
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/bank/v1beta1/bank.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "canto/erc20/v1/genesis.proto";
option go_package = "github.com/Canto-Network/Canto/v7/x/erc20/types";
// Msg defines the erc20 Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;
// ConvertCoin mints a ERC20 representation of the native Cosmos coin denom
// that is registered on the token mapping.
rpc ConvertCoin(MsgConvertCoin) returns (MsgConvertCoinResponse);
// ConvertERC20 mints a native Cosmos coin representation of the ERC20 token
// contract that is registered on the token mapping.
rpc ConvertERC20(MsgConvertERC20) returns (MsgConvertERC20Response);
// UpdateParams updates the parameters of the x/erc20 module.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
// RegisterCoinProposal defines a method to create a proposal to register a
// token pair for a native Cosmos coin.
rpc RegisterCoinProposal(MsgRegisterCoin) returns (MsgRegisterCoinResponse);
// RegisterERC20Proposal defines a method to create a proposal to register a
// token pair for an ERC20 token.
rpc RegisterERC20Proposal(MsgRegisterERC20)
returns (MsgRegisterERC20Response);
// ToggleTokenConversionProposal defines a method to create a proposal to
// toggle the conversion of a token pair.
rpc ToggleTokenConversionProposal(MsgToggleTokenConversion)
returns (MsgToggleTokenConversionResponse);
}
// MsgConvertCoin defines a Msg to convert a native Cosmos coin to a ERC20 token
message MsgConvertCoin {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "canto/MsgConvertCoin";
// Cosmos coin which denomination is registered in a token pair. The coin
// amount defines the amount of coins to convert.
cosmos.base.v1beta1.Coin coin = 1 [ (gogoproto.nullable) = false ];
// recipient hex address to receive ERC20 token
string receiver = 2;
// cosmos bech32 address from the owner of the given Cosmos coins
string sender = 3;
}
// MsgConvertCoinResponse returns no fields
message MsgConvertCoinResponse {}
// MsgConvertERC20 defines a Msg to convert a ERC20 token to a native Cosmos
// coin.
message MsgConvertERC20 {
// option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "canto/MsgConvertERC20";
// ERC20 token contract address registered in a token pair
string contract_address = 1;
// amount of ERC20 tokens to convert
string amount = 2 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
// bech32 address to receive native Cosmos coins
string receiver = 3;
// sender hex address from the owner of the given ERC20 tokens
string sender = 4;
}
// MsgConvertERC20Response returns no fields
message MsgConvertERC20Response {}
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
option (amino.name) = "canto/MsgUpdateParams";
// params defines the x/erc20 parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}
// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
//
// Since: cosmos-sdk 0.47
message MsgUpdateParamsResponse {}
// MsgRegisterCoinProposal is a gov Content type to register a token pair for a
// native Cosmos coin.
message MsgRegisterCoin {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
option (amino.name) = "canto/MsgRegisterCoin";
option (gogoproto.equal) = false;
// title of the proposal
string title = 2;
// proposal description
string description = 3;
// metadata of the native Cosmos coin
cosmos.bank.v1beta1.Metadata metadata = 4 [ (gogoproto.nullable) = false ];
}
message MsgRegisterCoinResponse {}
// MsgRegisterERC20Proposal is a gov Content type to register a token pair for
// an ERC20 token
message MsgRegisterERC20 {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
option (amino.name) = "canto/MsgRegisterERC20";
option (gogoproto.equal) = false;
// title of the proposa string title = 1;
string title = 2;
// proposal description
string description = 3;
// contract address of ERC20 token
string erc20address = 4;
}
message MsgRegisterERC20Response {}
// MsgToggleTokenConversionProposal is a gov Content type to toggle the
// conversion of a token pair.
message MsgToggleTokenConversion {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
option (amino.name) = "canto/MsgToggleTokenConversion";
option (gogoproto.equal) = true;
// title of the proposal
string title = 2;
// proposal description
string description = 3;
// token identifier can be either the hex contract address of the ERC20 or the
// Cosmos base denomination
string token = 4;
}
message MsgToggleTokenConversionResponse {}