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
//! # Neo Contract Module
//!
//! Comprehensive interfaces for interacting with Neo N3 smart contracts and tokens.
//!
//! ## Overview
//!
//! The neo_contract module provides a robust set of interfaces for interacting with
//! various types of smart contracts on the Neo N3 blockchain. This module abstracts
//! away the complexity of contract calls and state management, providing easy-to-use
//! APIs for developers.
//!
//! ## Key Features
//!
//! - **System Contracts**: Built-in interfaces for Neo N3 system contracts:
//! - NEO Token contract
//! - GAS Token contract
//! - Policy contract
//! - RoleManagement contract
//! - ContractManagement contract
//!
//! - **Token Standards**:
//! - NEP-17 fungible token standard (similar to Ethereum's ERC-20)
//! - NEP-11 non-fungible token standard (similar to Ethereum's ERC-721)
//!
//! - **Advanced Contract Interactions**:
//! - Neo Name Service (NNS) domain resolution
//! - Neo URI parsing and validation
//! - Contract iterator support for handling large result sets
//!
//! - **Famous Contract Integrations**:
//! - Flamingo Finance DeFi ecosystem
//! - NeoburgerNeo (bNEO) staking contract
//! - GrandShare voting and proposals
//! - NeoCompound yield aggregator
//!
//! - **Developer Tools**:
//! - Contract deployment helpers
//! - ABI and manifest handling utilities
//! - Contract invocation result parsing
//!
//! ## Examples
//!
//! ### Working with Standard Contracts
//!
//! ```no_run
//! use neo3::neo_contract::{GasToken, PolicyContract, FungibleTokenContract, FungibleTokenTrait};
//! use neo3::neo_protocol::{Account, AccountTrait};
//! use neo3::neo_clients::{HttpProvider, RpcClient};
//! use neo3::neo_types::ScriptHash;
//! use std::str::FromStr;
//!
//! async fn contract_examples() -> Result<(), Box<dyn std::error::Error>> {
//! // Set up a client connection
//! let provider = HttpProvider::new("https://testnet1.neo.org:443").unwrap();
//! let client = RpcClient::new(provider);
//!
//! // Create accounts for testing
//! let sender = Account::create()?;
//!
//! // 1. Working with the GAS token contract
//! let gas_token = GasToken::new(Some(&client));
//! let gas_balance = gas_token.get_balance_of(&sender.get_script_hash()).await?;
//! println!("GAS Balance: {}", gas_balance);
//!
//! // 2. Working with the Policy contract
//! let policy = PolicyContract::new(Some(&client));
//! let exec_fee_factor = policy.get_exec_fee_factor().await?;
//! let storage_price = policy.get_storage_price().await?;
//! println!("Execution Fee Factor: {}", exec_fee_factor);
//! println!("Storage Price: {}", storage_price);
//!
//! // 3. Working with a custom NEP-17 token
//! let token_hash = ScriptHash::from_str("0xd2a4cff31913016155e38e474a2c06d08be276cf")?;
//! let custom_token = FungibleTokenContract::new(&token_hash, Some(&client));
//! let custom_balance = custom_token.get_balance_of(&sender.get_script_hash()).await?;
//! println!("Token Balance: {}", custom_balance);
//!
//! Ok(())
//! }
//! ```
//!
//! ### Deploying a Smart Contract
//!
//! ```no_run
//! use neo3::neo_contract::ContractManagement;
//! use neo3::neo_types::NefFile;
//! use neo3::neo_clients::{HttpProvider, RpcClient};
//! use std::fs;
//!
//! async fn deploy_contract_example() -> Result<(), Box<dyn std::error::Error>> {
//! // Set up a client connection
//! let provider = HttpProvider::new("https://testnet1.neo.org:443").unwrap();
//! let client = RpcClient::new(provider);
//!
//! // Load contract files (NEF and manifest)
//! let nef_bytes = fs::read("path/to/contract.nef")?;
//! let manifest_bytes = fs::read("path/to/contract.manifest.json")?;
//!
//! // Parse the NEF file
//! let nef = NefFile::deserialize(&nef_bytes)?;
//!
//! // Create a native ContractManagement instance
//! let contract_mgmt = ContractManagement::new(Some(&client));
//!
//! // Deploy the contract
//! println!("Deploying contract...");
//! let tx_builder = contract_mgmt.deploy(
//! &nef,
//! &manifest_bytes,
//! None, // No deployment data
//! ).await?;
//!
//! println!("Contract deployment transaction built successfully!");
//!
//! Ok(())
//! }
//! ```
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;