From c33453843a3f0081c0422686f98ff531afc4cc79 Mon Sep 17 00:00:00 2001 From: OTC15203 <125013959+OTC15203@users.noreply.github.com> Date: Tue, 20 Feb 2024 05:20:49 -0600 Subject: [PATCH] Create My flow's https://www.notion.so/Good-dollar-ae9f7060c45d4ad193b746caa2cfc774?pvs=4 --- My flow's | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 My flow's diff --git a/My flow's b/My flow's new file mode 100644 index 000000000..7cc35812b --- /dev/null +++ b/My flow's @@ -0,0 +1,171 @@ +https://github.com/solana-labs/break.git +Dyd6KR16VMkZFaHRcFQbG3LVQnuX3sat7g8XvgfWVQk8 +https://solscan.io/user/verify-email?email=Mista.panda1003@gmail.com&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1ZDQ4NDZkYTFmNGFiZmZiM2M5ZTJkOSIsImVtYWlsIjoiTWlzdGEucGFuZGExMDAzQGdtYWlsLmNvbSIsImFjdGlvbiI6ImNvbmZpcm1SZWdpc3RlciIsImlhdCI6MTcwODQyNjM0OSwiZXhwIjoxNzA4NDgwMzQ5fQ.gWMo87ML_tAf5GYZAPrLKs3Dpl659EROoKPAVkdWa1YeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjcmVhdGVkQXQiOjE3MDg0MjY1Mzk2NzUsImVtYWlsIjoiTWlzdGEucGFuZGExMDAzQGdtYWlsLmNvbSIsImFjdGlvbiI6InRva2VuLWFwaSIsImlhdCI6MTcwODQyNjUzOX0.toFwYcllVoT7bgea83Pa7BhqiOco5UsYhPpijywId- +/** + *Submitted for verification at celoscan.io on 2022-04-01 +*/ + +pragma solidity ^0.5.3; + + +library Address { + + function isContract(address account) internal view returns (bool) { + + + + bytes32 codehash; + bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; + + assembly { codehash := extcodehash(account) } + return (codehash != accountHash && codehash != 0x0); + } + + + function toPayable(address account) internal pure returns (address payable) { + return address(uint160(account)); + } + + + function sendValue(address payable recipient, uint256 amount) internal { + require(address(this).balance >= amount, "Address: insufficient balance"); + + + (bool success, ) = recipient.call.value(amount)(""); + require(success, "Address: unable to send value, recipient may have reverted"); + } +} + +contract Proxy { + + bytes32 private constant OWNER_POSITION = bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1); + + bytes32 private constant IMPLEMENTATION_POSITION = bytes32( + uint256(keccak256("eip1967.proxy.implementation")) - 1 + ); + + event OwnerSet(address indexed owner); + event ImplementationSet(address indexed implementation); + + constructor() public { + _setOwner(msg.sender); + } + + + modifier onlyOwner() { + require(msg.sender == _getOwner(), "sender was not owner"); + _; + } + + + function() external payable { + bytes32 implementationPosition = IMPLEMENTATION_POSITION; + + address implementationAddress; + + + assembly { + implementationAddress := sload(implementationPosition) + } + + + + require(implementationAddress != address(0), "No Implementation set"); + require(Address.isContract(implementationAddress), "Invalid contract address"); + + assembly { + + let newCallDataPosition := mload(0x40) + mstore(0x40, add(newCallDataPosition, calldatasize)) + calldatacopy(newCallDataPosition, 0, calldatasize) + + + + let delegatecallSuccess := delegatecall( + gas, + implementationAddress, + newCallDataPosition, + calldatasize, + 0, + 0 + ) + + + let returnDataSize := returndatasize + let returnDataPosition := mload(0x40) + mstore(0x40, add(returnDataPosition, returnDataSize)) + returndatacopy(returnDataPosition, 0, returnDataSize) + + + switch delegatecallSuccess + case 0 { + revert(returnDataPosition, returnDataSize) + } + default { + return(returnDataPosition, returnDataSize) + } + } + } + + + function _transferOwnership(address newOwner) external onlyOwner { + _setOwner(newOwner); + } + + + function _setAndInitializeImplementation(address implementation, bytes calldata callbackData) + external + payable + onlyOwner + { + _setImplementation(implementation); + bool success; + bytes memory returnValue; + (success, returnValue) = implementation.delegatecall(callbackData); + require(success, "initialization callback failed"); + } + + + function _getImplementation() external view returns (address implementation) { + bytes32 implementationPosition = IMPLEMENTATION_POSITION; + + assembly { + implementation := sload(implementationPosition) + } + } + + + function _setImplementation(address implementation) public onlyOwner { + bytes32 implementationPosition = IMPLEMENTATION_POSITION; + + require(Address.isContract(implementation), "Invalid contract address"); + + + assembly { + sstore(implementationPosition, implementation) + } + + emit ImplementationSet(implementation); + } + + + function _getOwner() public view returns (address owner) { + bytes32 position = OWNER_POSITION; + + assembly { + owner := sload(position) + } + } + + function _setOwner(address newOwner) private { + require(newOwner != address(0), "owner cannot be 0"); + bytes32 position = OWNER_POSITION; + + assembly { + sstore(position, newOwner) + } + emit OwnerSet(newOwner); + } +} + +contract GoldTokenProxy is Proxy {}0x471EcE3750Da237f93B8E339c536989b8978a438