Skip to content

Commit

Permalink
Merge pull request #997 from phenix3443/fix/collided-filename
Browse files Browse the repository at this point in the history
fix: collided filename and typo
  • Loading branch information
yingjingyang authored Oct 16, 2023
2 parents 289b57f + e1c2940 commit 0091e6a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 128 deletions.
16 changes: 10 additions & 6 deletions basic/17-etherjs-wallet-develop/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
[中文](./README-CN.md) / English

# wallet development

HD Wallet (Hierarchical Deterministic Wallet), Wallet Protocol: BIP32, BIP44, BIP39
[Wallet Principle](https://learnblockchain.cn/2018/09/28/hdwallet/)

## wallet type

Created by:

1. Random number
2. Private key
3. Mnemonic
4. keystore
2. Private key
3. Mnemonic
4. keystore
A Keystore file is a file format (JSON) in which the Ethereum wallet stores private keys. Use the password set by the user to encrypt to a certain extent, and the degree of protection depends on the password strength of the user to encrypt the wallet.
5. Brain wallets (etherjs 5 has been removed)

Expand All @@ -27,6 +30,7 @@ const wallet = new Wallet(privateKey, provider);
```

or

```js
const wallet = new Wallet(privateKey);
wallet.provider = provider;
Expand All @@ -36,6 +40,6 @@ If you use a normal JS number object to store the operation, it may cause abnorm

## Reference link

- https://learnblockchain.cn/2019/04/11/wallet-dev-guide/#ethers.js
- http://zhaozhiming.github.io/blog/2018/04/25/how-to-use-ethers-dot-js/
- https://learnblockchain.cn/2018/10/25/eth-web-wallet_2/
- <https://learnblockchain.cn/2019/04/11/wallet-dev-guide/#ethers.js>
- <http://zhaozhiming.github.io/blog/2018/04/25/how-to-use-ethers-dot-js/>
- <https://learnblockchain.cn/2018/10/25/eth-web-wallet_2/>
41 changes: 0 additions & 41 deletions basic/17-etherjs-wallet-develop/readme.md

This file was deleted.

24 changes: 14 additions & 10 deletions basic/20-flash-loan/uniswapv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,49 @@ There is a flash loan function that can be called flash swap in v2 version of Un
The realization principle of flash swap is:

1. lender can borrow from contract one of x, y token (or both)
2. lender destined the borrow amount and the params of callback function then calling flashswap
2. lender destined the borrow amount and the params of callback function then calling Flashswap
3. The contract will send the token to lender which amount destined by user
4. when these tokens send successfully, the contract Uniswap Pair will calling a destined callback function to the contract address also destined by lender, and pass the params of callback function in
5. After calling is over, Uniswap Pair will check whether balance of x, y token sufficient $$ x′⋅y′≥k $$

All these process above are also happened in one same transaction.

In flashswap, user don't need to prepay token can get token what he want, and all you need to do is return these token which need pay in callback function to contract. After flashswap finished, the prices in AMM pool will changed (if use same token to repay it won't change). Flash swap can be used for arbitrage between AMMs, liquidation of lending platforms and other operations.
In Flashswap, user don't need to prepay token can get token what he want, and all you need to do is return these token which need pay in callback function to contract. After Flashswap finished, the prices in AMM pool will changed (if use same token to repay it won't change). Flash swap can be used for arbitrage between AMMs, liquidation of lending platforms and other operations.

Flashswap is similar to a more powerful flash loan, just one api can deal the loan and transaction operation. If you want to know more about flash swap, see [official docs](https://docs.uniswap.org/protocol/V2/guides/smart-contract-integration/using-flash-swaps).


## Steps

- Install dependencies

```shell
yarn
```

- Config the envrioument
- Config the environment

```shell
cp .env.example .env
# set INFURA_ID , PRIVATE_KEY in .env
```

- Deploy the contract

```shell
npx hardhat run scripts/deploy_UniswapFlashloaner.js --network kovan
```

- Start flashloan

```shell
npx hardhat run scripts/flashloan_test.js --network kovan
```

## Reference link

- Detail of flash loan:https://liaoph.com/uniswap-v3-6/
- uniswap-flash-swapper: https://github.com/Austin-Williams/uniswap-flash-swapper
- Flash Swaps: https://docs.uniswap.org/protocol/V2/guides/smart-contract-integration/using-flash-swaps
- FlashSwap Example: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/examples/ExampleFlashSwap.sol
- OneSwap Arbitrage Guide Based on UniswapV2 Flash Loan: https://juejin.cn/post/6878116429590167565
- Get kovan Dai Token: https://docs.alchemist.wtf/copper/auction-creators/getting-test-tokens-for-balancer-lbps-on-the-kovan-testnet
- Detail of flash loan:<https://liaoph.com/uniswap-v3-6/>
- uniswap-flash-swapper: <https://github.com/Austin-Williams/uniswap-flash-swapper>
- Flash Swaps: <https://docs.uniswap.org/protocol/V2/guides/smart-contract-integration/using-flash-swaps>
- Flashswap Example: <https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/examples/ExampleFlashswap.sol>
- OneSwap Arbitrage Guide Based on UniswapV2 Flash Loan: <https://juejin.cn/post/6878116429590167565>
- Get kovan Dai Token: <https://docs.alchemist.wtf/copper/auction-creators/getting-test-tokens-for-balancer-lbps-on-the-kovan-testnet>
51 changes: 0 additions & 51 deletions basic/20-flash-loan/uniswapv2/readme.md

This file was deleted.

2 changes: 1 addition & 1 deletion crypto/Mina/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## Reference

- mina 介绍:<https://mp.weixin.qq.com/s/hgZBkDDhuWa4yxVtrbCpnA>
- mina zk: https://o1-labs.github.io/proof-systems/introduction.html
- mina zk: <https://o1-labs.github.io/proof-systems/introduction.html>
- snapps: <https://minaprotocol.com/blog/what-are-snapps>
- SnarkyJS: <https://docs.minaprotocol.com/en/snapps/snarkyjs-reference>
- snapps:
Expand Down
19 changes: 0 additions & 19 deletions crypto/Mina/readme.md

This file was deleted.

0 comments on commit 0091e6a

Please sign in to comment.