【每日Telegram免費掘Hi Dollar 】
5月果陣有個玩開Crypto朋友介紹用TG掘Hi Dollar,我見只係每日禁一次TG又唔洗錢就玩下。
最近發現官網公佈8月8日Hi Dollar正式在Uniswap上市,睇番官網話每個Hi Dollar價值USD0.3057,我唔知係咪真係有價值,等於年幾前的Pi Coin咁,到而家都仲係佛系咁掘緊等上市,反正又唔會有損失。
簡單介紹下Hi Dollar係由Bitcoin.com的前CEO Stefan Rust 及前CMO Sean Rach一起創辦。此項目的初衷是成為全世界的區塊鏈銀行,它是一個非營利金融服務,這一點非常好笑,直接使用聊天軟體就可以使用的金融平台,賺取,轉帳都可以直接在聊天軟件上完成,甚至還可以直接使用命令購買虛擬貨幣。
Hi Dollar 會隨著用戶量上升而下降,而家係每日2.5 Hi dollar,到達100萬用戶(根據官網講而家有73萬用戶) 之後就會變成每日1 Hi dollar,所以而家仲係屬於早期階段,有興趣可以上去以下官網連結了解下。
https://hi.com/Cryptobot
🔥圖中係我掘左咁耐的Wallet: USD451
✅TG註冊教學:
1. 點選HI官網連結,首頁下方的Telegram
2. 進入Hi Telegram,設定語言並申請帳號
3. 之後每天的08:00~23:59,點擊選單,領取Hi dollar
4. 再自行決定做唔做埋KYC (身份認證),聽聞到時上市後,如果要領取屬於自己的Hi Dollar係需要KYC,而且所得到的獎勵幣要上市一年後先可以解禁賣出。
同時也有1部Youtube影片,追蹤數超過5,140的網紅寶博士,也在其Youtube影片中提到,【本集 EP56 原始播出時間 October 21, 2020】使用我的推薦連結 https://crypto.com/app/juchunko ,註冊 Crypto.com ,我們都將獲得50美元。推薦碼 (Referral Code) 👉 juchunko *2020/11/1 起將調整為2...
uniswap wallet 在 คุยการเงินกับที Facebook 的最讚貼文
Decentralized Exchange และ Centralized Exchange ต่างกันอย่างไร
ก่อนอื่นผมจะขอพูดถึง Centralized Exchange ก่อนเนื่องจากเพื่อนๆที่เริ่มต้นเข้ามาศึกษา DeFi ใหม่ๆอาจจะยังสับสนอยู่ Centralized Exchange ( CEX ) เป็นแพลตฟอร์มการแลกเปลี่ยนทรัพย์สินดิจิตอล แบบมีศูนย์กลาง ยกตัวอย่างที่เพื่อนๆคุ้นเคยกันก็คือ Bitkub, Zipmex, SatangPro หรือในตลาดโลก เช่น Binance, Coinbase, Kucoin
Decentralized Exhange ( DEX ) เป็นแพลตฟอร์มแลกเปลี่ยนโดยไม่ต้องมีตัวกลาง โดยมีหลักการทำงานที่เรียกว่า Automate Market Maker ( AMM ) ในการจัดการกับเรตราคาแลกเปลี่ยน โดยคำนวณจากสมการ X * Y = K และส่วนใหญ่จะเปิดให้ใครก็ได้มาวางสภาพคล่องให้กับระบบ
โดยจะหักค่าธรรมเนียมการเทรดส่วนหนึ่งมาจ่ายให้กับคนที่วางสภาพคล่อง ยกตัวอย่าง DEX ที่รู้จักกันเช่น Uniswap, PancakeSwap, ShushiSwap เป็นต้น
เกร็ดความรู้สำหรับการเทรดบน Decentralized Exchange
1.การวางสภาพคล่องให้กับระบบ หรือ Liquidity Mining จะต้องวางเป็นคู่เหรียญในสัดส่วนมูลค่า 50:50
2.Liquidity Mining เหมาะกับกรณีที่ ราคาเหรียญไม่ผันผวนมาก เนื่องจาก Impermanent loss ที่สูญเสียไปอาจไม่คุ้มกับผลตอบแทน
3.Impermanent loss เกิดขึ้นทั้งช่วงที่ราคาเหรียญขึ้น และ ราคาเหรียญลง โดยประมาณคือ หากราคาเหรียญ A เพิ่มขึ้น 400% หรือลดลง 75% Impermanent loss ที่เสียไปจะอยู่ที่ 20% เมื่อเหรียญ B มูลค่าคงที่
4.Price impact ที่เกิดจากสัดส่วนของปรืมาณการเทรดของเรา ต่อ ปริมาณสภาพคล่องในระบบ ซึ่งหาก เราเทรดในปริมาณมากๆ หรือ สภาพคล่องใน Pool น้อย เราจะโดยส่วนต่างราคาที่คลาดเคลื่อนจากที่ควรจะเป็น
5.การเทรดทุกครั้งมีการเสียค่า Gas หรือ ค่าธรรมเนียมระบบ Blockchain นั้นๆดังนั้นการเทรดในปริมาณน้อยๆอาจไม่คุ้มค่า
6.การใช้งาน DEX ครั้งแรกผู้ใช้ต้อง Approve contract ของ Wallet ตัวเองกับ DEX ก่อน ตรงนี้ก็มีค่า Gas ในการ Approve เช่นกัน และควรระวังการ Approve ใน DEX ที่มีความน่าเชื่อถือต่ำเนื่องจาก Smart contract สามารถดึงเงินออกจาก Wallet เราได้
7.บาง DEX มีการแจก Governence Token ให้กับผู้วางสภาพคล่องระบบทำให้ผลตอบแทนอาจสูงขึ้นไปอีก
........................................
ติดตามข้อมูล เศรษฐกิจ การลงทุนในต่างประเทศ ในไทย ได้ที่คุยการเงินกับที
........................................
แอด ตอง
uniswap wallet 在 Taipei Ethereum Meetup Facebook 的最佳貼文
📜 [專欄新文章] Reason Why You Should Use EIP1167 Proxy Contract. (With Tutorial)
✍️ Ping Chen
📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium
EIP1167 minimal proxy contract is a standardized, gas-efficient way to deploy a bunch of contract clones from a factory.
1. Who may consider using EIP1167
For some DApp that are creating clones of a contract for its users, a “factory pattern” is usually introduced. Users simply interact with the factory to get a copy. For example, Gnosis Multisig Wallet has a factory. So, instead of copy-and-paste the source code to Remix, compile, key in some parameters, and deploy it by yourself, you can just ask the factory to create a wallet for you since the contract code has already been on-chain.
The problem is: we need standalone contract instances for each user, but then we’ll have many copies of the same bytecode on the blockchain, which seems redundant. Take multisig wallet as an example, different multisig wallet instances have separate addresses to receive assets and store the wallet’s owners’ addresses, but they can share the same program logic by referring to the same library. We call them ‘proxy contracts’.
One of the most famous proxy contract users is Uniswap. It also has a factory pattern to create exchanges for each ERC20 tokens. Different from Gnosis Multisig, Uniswap only has one exchange instance that contains full bytecode as the program logic, and the remainders are all proxies. So, when you go to Etherscan to check out the code, you’ll see a short bytecode, which is unlikely an implementation of an exchange.
0x3660006000376110006000366000732157a7894439191e520825fe9399ab8655e0f7085af41558576110006000f3
What it does is blindly relay every incoming transaction to the reference contract 0x2157a7894439191e520825fe9399ab8655e0f708by delegatecall.
Every proxy is a 100% replica of that contract but serving for different tokens.
The length of the creation code of Uniswap exchange implementation is 12468 bytes. A proxy contract, however, has only 46 bytes, which is much more gas efficient. So, if your DApp is in a scenario of creating copies of a contract, no matter for each user, each token, or what else, you may consider using proxy contracts to save gas.
2. Why use EIP1167
According to the proposal, EIP is a “minimal proxy contract”. It is currently the known shortest(in bytecode) and lowest gas consumption overhead implementation of proxy contract. Though most ERCs are protocols or interfaces, EIP1167 is the “best practice” of a proxy contract. It uses some EVM black magic to optimize performance.
EIP1167 not only minimizes length, but it is also literally a “minimal” proxy that does nothing but proxying. It minimizes trust. Unlike other upgradable proxy contracts that rely on the honesty of their administrator (who can change the implementation), address in EIP1167 is hardcoded in bytecode and remain unchangeable.
That brings convenience to the community.
Etherscan automatically displays code for EIP1167 proxies.
When you see an EIP1167 proxy, you can definitely regard it as the contract that it points to. For instance, if Etherscan finds a contract meets the format of EIP1167, and the reference implementation’s code has been published, it will automatically use that code for the proxy contract. Unfortunately, non-standard EIP1167 proxies like Uniswap will not benefit from this kind of network effect.
3. How to upgrade a contract to EIP1167 compatible
*Please read all the steps before use, otherwise there might have problems.
A. Build a clone factory
For Vyper, there’s a function create_with_code_of(address)that creates a proxy and returns its address. For Solidity, you may find a reference implementation here.
function createClone(address target) internal returns (address result){ bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create(0, clone, 0x37) }}
You can either deploy the implementation contract first or deploy it with the factory’s constructor. I’ll suggest the former, so you can optimize it with higher runs.
contract WalletFactory is CloneFactory { address Template = "0xc0ffee"; function createWallet() external returns (address newWallet) { newWallet = createClone(Template); }}
B. Replace constructor with initializer
When it comes to a contract, there are two kinds of code: creation code and runtime code. Runtime code is the actual business logic stored in the contract’s code slot. Creation code, on the other hand, is runtime code plus an initialization process. When you compile a solidity source code, the output bytecode you get is creation code. And the permanent bytecode you can find on the blockchain is runtime code.
For EIP1167 proxies, we say it ‘clones’ a contract. It actually clones a contract’s runtime code. But if the contract that it is cloning has a constructor, the clone is not 100% precise. So, we need to slightly modify our implementation contract. Replace the constructor with an ‘initializer’, which is part of the permanent code but can only be called once.
// constructorconstructor(address _owner) external { owner = _owner;}// initializerfunction set(address _owner) external { require(owner == address(0)); owner = _owner;}
Mind that initializer is not a constructor, so theoretically it can be called multiple times. You need to maintain the edge case by yourself. Take the code above as an example, when the contract is initialized, the owner must never be set to 0, or anyone can modify it.
C. Don’t assign value outside a function
As mentioned, a creation code contains runtime code and initialization process. A so-called “initialization process” is not only a constructor but also all the variable assignments outside a function. If an EIP1167 proxy points to a contract that assigns value outside a function, it will again have different behavior. We need to remove them.
There are two approaches to solve this problem. The first one is to turn all the variables that need to be assigned to constant. By doing so, they are no longer a variable written in the contract’s storage, but a constant value that hardcoded everywhere it is used.
bytes32 public constant symbol = "4441490000000000000000000000000000000000000000000000000000000000";uint256 public constant decimals = 18;
Second, if you really want to assign a non-constant variable while initializing, then just add it to the initializer.
mapping(address => bool) public isOwner;uint public dailyWithdrawLimit;uint public signaturesRequired;
function set(address[] _owner, uint limit, uint required) external { require(dailyWithdrawLimit == 0 && signaturesRequired == 0); dailyWithdrawLimit = limit; signaturesRequired = required; //DO SOMETHING ELSE}
Our ultimate goal is to eliminate the difference between runtime code and creation code, so EIP1167 proxy can 100% imitate its implementation.
D. Put them all together
A proxy contract pattern splits the deployment process into two. But the factory can combine two steps into one, so users won’t feel different.
contract multisigWallet { //wallet interfaces function set(address[] owners, uint required, uint limit) external;}contract walletFactory is cloneFactory { address constant template = "0xdeadbeef"; function create(address[] owners, uint required, uint limit) external returns (address) { address wallet = createClone(template); multisigWallet(wallet).set(owners, required, limit); return wallet; }}
Since both the factory and the clone/proxy has exactly the same interface, no modification is required for all the existing DApp, webpage, and tools, just enjoy the benefit of proxy contracts!
4. Drawbacks
Though proxy contract can lower the storage fee of deploying multiple clones, it will slightly increase the gas cost of each operation in the future due to the usage of delegatecall. So, if the contract is not so long(in bytes), and you expect it’ll be called millions of times, it’ll eventually be more efficient to not use EIP1167 proxies.
In addition, proxy pattern also introduces a different attack vector to the system. For EIP1167 proxies, trust is minimized since the address they point to is hardcoded in bytecode. But, if the reference contract is not permanent, some problems may happen.
You might ever hear of parity multisig wallet hack. There are multiple proxies(not EIP1167) that refer to the same implementation. However, the wallet has a self-destruct function, which empties both the storage and the code of a contract. Unfortunately, there was a bug in Parity wallet’s access control and someone accidentally gained the ownership of the original implementation. That did not directly steal assets from other parity wallets, but then the hacker deleted the original implementation, making all the remaining wallets a shell without functionality, and lock assets in it forever.
https://cointelegraph.com/news/parity-multisig-wallet-hacked-or-how-come
Conclusion
In brief, the proxy factory pattern helps you to deploy a bunch of contract clones with a considerably lower gas cost. EIP1167 defines a bytecode format standard for minimal proxy and it is supported by Etherscan.
To upgrade a contract to EIP1167 compatible, you have to remove both constructor and variable assignment outside a function. So that runtime code will contain all business logic that proxies may need.
Here’s a use case of EIP1167 proxy contract: create adapters for ERC1155 tokens to support ERC20 interface.
pelith/erc-1155-adapter
References
https://eips.ethereum.org/EIPS/eip-1167
https://blog.openzeppelin.com/on-the-parity-wallet-multisig-hack-405a8c12e8f7/
Donation:
pingchen.eth
0xc1F9BB72216E5ecDc97e248F65E14df1fE46600a
Reason Why You Should Use EIP1167 Proxy Contract. (With Tutorial) was originally published in Taipei Ethereum Meetup on Medium, where people are continuing the conversation by highlighting and responding to this story.
👏 歡迎轉載分享鼓掌
uniswap wallet 在 寶博士 Youtube 的最佳貼文
【本集 EP56 原始播出時間 October 21, 2020】使用我的推薦連結 https://crypto.com/app/juchunko ,註冊 Crypto.com ,我們都將獲得50美元。推薦碼 (Referral Code) 👉 juchunko
*2020/11/1 起將調整為25美元
謹慎理財.信用至上
00:00:00 簡介
07:43:17 交易所怎麼選
13:28:09 用 DeFi 賺錢?
13:54:11 什麼是穩定幣
18:39:12 Uni幣大空投
24:37:04 ChainLink 是什麼?
26:21:23 UniSwap DeFi 交易所
26:41:00 Unisocks 百萬名襪的誕生
35:32:11 CRO 介紹
📍基礎知識:
1-1. 區塊鏈錢包:Trust Wallet、Dapp Pocket、Blocto
1-2. 區塊鏈交易所:Binance、BitoPro、MaiCoin、ACE、數寶、BitAsset
KYC:Know Your Customer
CoinMarketCap
2. Defi:去中心化金融的簡稱(DEcentralized FInance)
3. 穩定幣:Bitfinex-USDT、Dai、Coinbase-USDC
📍Unisocks https://unisocks.exchange/
📍ourzora 錄音帶 https://ourzora.com/rac/tape
📍MCO推薦碼:juchunko(申請成功你我各獲得$50美金等值MCO加密幣)
📍CryptoAvatars https://cryptoavatars.io/#/about
📍NFT卡牌遊戲「NBA TopShot 」
複習:
EP38 | 你要不要相信聯準會?ft. 高培勛 https://youtu.be/7YIPMRjeg3s
EP52 | 壽司之亂【吸血鬼之術 來龍去脈】 ft.宋倬榮 https://youtu.be/pwdCd4iG7co
⭐Blocto
文章:https://bit.ly/2YEmH1J
APP :https://bit.ly/3hxpT6S
- - - - - -- - - - - -
⭐葛如鈞(寶博士)
Facebook▶️https://www.facebook.com/dAAAb
YouTube▶️https://youtube.com/c/dAAAb
- - - - - -- - - - - -
📣訂閱SoundOn
APP▶️http://www.soundon.fm/download
Facebook⏩https://reurl.cc/1QxXzQ
官網▶️https://www.soundon.fm
Instagram▶️ https://reurl.cc/XX6Z3j
- - - - - -- - - - - -
🎵片頭:Music from https://icons8.com/music/author/savvier Fame Inc by SAVVIER
🎵片尾:Music from https://icons8.com/music/author/nordgroove by NORDGROOVE