Skip to main content

bobcat_entrypoints/
lib.rs

1
2use bobcat_cd::{U, EvmCdAddress, 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#[cfg(feature = "alloc")]
77#[derive(Debug, Clone, PartialEq, EvmCdSerialise, EvmCdDeserialise)]
78#[evm_selector]
79pub enum Eip721 {
80    BalanceOf {
81        owner: EvmCdAddress,
82    },
83    OwnerOf {
84        token_id: U,
85    },
86    SafeTransferFrom {
87        from: EvmCdAddress,
88        to: EvmCdAddress,
89        token_id: U,
90    },
91    #[evm_selector("safeTransferFrom(address,address,uint256,bytes)")]
92    SafeTransferFromWithData {
93        from: EvmCdAddress,
94        to: EvmCdAddress,
95        token_id: U,
96        data: Vec<u8>,
97    },
98    TransferFrom {
99        from: EvmCdAddress,
100        to: EvmCdAddress,
101        token_id: U,
102    },
103    Approve {
104        approved: EvmCdAddress,
105        token_id: U,
106    },
107    SetApprovalForAll {
108        operator: EvmCdAddress,
109        approved: bool,
110    },
111    GetApproved {
112        token_id: U,
113    },
114    IsApprovedForAll {
115        owner: EvmCdAddress,
116        operator: EvmCdAddress,
117    },
118}