...move中闪贷的实现
让我们阅读move官方代码库中的案例,了解sui move中如何实现闪贷。
有三个重要结构:
* FlashLender
```solidity
struct FlashLender has key {
id: UID,
/// Coins available to be lent to prospective borrowers
...
...,将 lib.rs 文件中的代码替换为以下内容。这段代码实现了通过 CPI 调用 System Program 进行 Sol 转账的功能。为了帮助新手更好地理解,代码中附带了详细的注释:
``` rust
#![allow(clippy::result_large_err)] // 允许编译器忽略关于大错...