Skip to main content

bobcat_entrypoints/
lib.rs

1
2use bobcat_cd::{U, EvmCdAddress, EvmCdBytes, EvmCdSerialise, EvmCdDeserialise};
3
4#[derive(Debug, Clone, PartialEq, EvmCdSerialise, EvmCdDeserialise)]
5#[evm_selector]
6pub enum Eip20 {
7    TotalSupply,
8    BalanceOf {
9        owner: EvmCdAddress,
10    },
11    Transfer {
12        to: EvmCdAddress,
13        value: U,
14    },
15    Allowance {
16        owner: EvmCdAddress,
17        spender: EvmCdAddress,
18    },
19    Approve {
20        spender: EvmCdAddress,
21        value: U,
22    },
23    TransferFrom {
24        from: EvmCdAddress,
25        to: EvmCdAddress,
26        value: U,
27    },
28    Name,
29    Symbol,
30    Decimals,
31}
32
33#[derive(Debug, Clone, PartialEq, EvmCdSerialise, EvmCdDeserialise)]
34#[evm_selector]
35pub enum Eip20Permit {
36    TotalSupply,
37    BalanceOf {
38        owner: EvmCdAddress,
39    },
40    Transfer {
41        to: EvmCdAddress,
42        value: U,
43    },
44    Allowance {
45        owner: EvmCdAddress,
46        spender: EvmCdAddress,
47    },
48    Approve {
49        spender: EvmCdAddress,
50        value: U,
51    },
52    TransferFrom {
53        from: EvmCdAddress,
54        to: EvmCdAddress,
55        value: U,
56    },
57    Name,
58    Symbol,
59    Decimals,
60
61    Permit {
62        owner: EvmCdAddress,
63        spender: EvmCdAddress,
64        value: U,
65        deadline: U,
66        v: u8,
67        r: [u8; 32],
68        s: [u8; 32],
69    },
70    Nonces {
71        owner: EvmCdAddress,
72    },
73    DomainSeparator,
74}
75
76#[derive(Debug, Clone, PartialEq, EvmCdSerialise, EvmCdDeserialise)]
77#[evm_selector]
78pub enum Eip721DataSlice<const MAX_DATA: usize> {
79    BalanceOf {
80        owner: EvmCdAddress,
81    },
82    OwnerOf {
83        token_id: U,
84    },
85    SafeTransferFrom {
86        from: EvmCdAddress,
87        to: EvmCdAddress,
88        token_id: U,
89    },
90    #[evm_selector("safeTransferFrom(address,address,uint256,bytes)")]
91    SafeTransferFromWithData {
92        from: EvmCdAddress,
93        to: EvmCdAddress,
94        token_id: U,
95        data: EvmCdBytes<MAX_DATA>,
96    },
97    TransferFrom {
98        from: EvmCdAddress,
99        to: EvmCdAddress,
100        token_id: U,
101    },
102    Approve {
103        approved: EvmCdAddress,
104        token_id: U,
105    },
106    SetApprovalForAll {
107        operator: EvmCdAddress,
108        approved: bool,
109    },
110    GetApproved {
111        token_id: U,
112    },
113    IsApprovedForAll {
114        owner: EvmCdAddress,
115        operator: EvmCdAddress,
116    },
117}
118
119#[cfg(feature = "alloc")]
120#[derive(Debug, Clone, PartialEq, EvmCdSerialise, EvmCdDeserialise)]
121#[evm_selector]
122pub enum Eip721DataVec {
123    BalanceOf {
124        owner: EvmCdAddress,
125    },
126    OwnerOf {
127        token_id: U,
128    },
129    SafeTransferFrom {
130        from: EvmCdAddress,
131        to: EvmCdAddress,
132        token_id: U,
133    },
134    #[evm_selector("safeTransferFrom(address,address,uint256,bytes)")]
135    SafeTransferFromWithData {
136        from: EvmCdAddress,
137        to: EvmCdAddress,
138        token_id: U,
139        data: Vec<u8>,
140    },
141    TransferFrom {
142        from: EvmCdAddress,
143        to: EvmCdAddress,
144        token_id: U,
145    },
146    Approve {
147        approved: EvmCdAddress,
148        token_id: U,
149    },
150    SetApprovalForAll {
151        operator: EvmCdAddress,
152        approved: bool,
153    },
154    GetApproved {
155        token_id: U,
156    },
157    IsApprovedForAll {
158        owner: EvmCdAddress,
159        operator: EvmCdAddress,
160    },
161}