diff --git a/basic/17-etherjs-wallet-develop/README.md b/basic/17-etherjs-wallet-develop/README.md index 59b0b8744..7088c8eb7 100644 --- a/basic/17-etherjs-wallet-develop/README.md +++ b/basic/17-etherjs-wallet-develop/README.md @@ -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) @@ -27,6 +30,7 @@ const wallet = new Wallet(privateKey, provider); ``` or + ```js const wallet = new Wallet(privateKey); wallet.provider = provider; @@ -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/ \ No newline at end of file +- +- +- diff --git a/basic/17-etherjs-wallet-develop/readme.md b/basic/17-etherjs-wallet-develop/readme.md deleted file mode 100644 index 59b0b8744..000000000 --- a/basic/17-etherjs-wallet-develop/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -[中文](./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 - 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) - -## provider type - -1. Etherscan Provider: It requires two parameters to connect the Etherscan API, one is the network name, and the other is the token required to query the API (the API token is not necessary when querying the Etherscan API, but if not, the subject will be limited of 5 calls per second). -2. Json Rpc Provider: The Provider that connects to the local Ethereum network. -3. Infura Provider: The Provider that connects to the Infura network. Infura is a set of Ethereum infrastructure services, and also has the Ethereum main network and test network. -4. Web3 Provider: A provider that connects to an existed web3 object. -5. Fallback Provider: Connect to a group of providers that can be of various types. If there is a problem with the previous provider, it will automatically connect to the latter. - -```js -const provider = providers.getDefaultProvider(); -const wallet = new Wallet(privateKey, provider); -``` - -or -```js -const wallet = new Wallet(privateKey); -wallet.provider = provider; -``` - -If you use a normal JS number object to store the operation, it may cause abnormal results due to data overflow. - -## 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/ \ No newline at end of file diff --git a/basic/20-flash-loan/uniswapv2/README.md b/basic/20-flash-loan/uniswapv2/README.md index 51dfb7330..2694863ee 100644 --- a/basic/20-flash-loan/uniswapv2/README.md +++ b/basic/20-flash-loan/uniswapv2/README.md @@ -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: +- uniswap-flash-swapper: +- Flash Swaps: +- Flashswap Example: +- OneSwap Arbitrage Guide Based on UniswapV2 Flash Loan: +- Get kovan Dai Token: diff --git a/basic/20-flash-loan/uniswapv2/readme.md b/basic/20-flash-loan/uniswapv2/readme.md deleted file mode 100644 index 51dfb7330..000000000 --- a/basic/20-flash-loan/uniswapv2/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -[中文](./README-CN.md) / English - -# Uniswap v2 Flashswap introduce - -There is a flash loan function that can be called flash swap in v2 version of Uniswap. Thus you can borrow x token from a transaction pair, but repay with y token. - -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 -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. - -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 -```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 diff --git a/crypto/Mina/README.md b/crypto/Mina/README.md index 59b1b94fd..ee7029c92 100644 --- a/crypto/Mina/README.md +++ b/crypto/Mina/README.md @@ -10,7 +10,7 @@ ## Reference - mina 介绍: -- mina zk: https://o1-labs.github.io/proof-systems/introduction.html +- mina zk: - snapps: - SnarkyJS: - snapps: diff --git a/crypto/Mina/readme.md b/crypto/Mina/readme.md deleted file mode 100644 index 59b1b94fd..000000000 --- a/crypto/Mina/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# MINA - -- [Mina Intro](./docs/mina.md) - -## Mina workshop - -- youtube: -- ppt: - -## Reference - -- mina 介绍: -- mina zk: https://o1-labs.github.io/proof-systems/introduction.html -- snapps: -- SnarkyJS: -- snapps: - -- Snapp Developer Resource Kit : -