Found 41 repositories(showing 30)
# Liberty House Club **A Parallel Binance Chain to Enable Smart Contracts** _NOTE: This document is under development. Please check regularly for updates!_ ## Table of Contents - [Motivation](#motivation) - [Design Principles](#design-principles) - [Consensus and Validator Quorum](#consensus-and-validator-quorum) * [Proof of Staked Authority](#proof-of-staked-authority) * [Validator Quorum](#validator-quorum) * [Security and Finality](#security-and-finality) * [Reward](#reward) - [Token Economy](#token-economy) * [Native Token](#native-token) * [Other Tokens](#other-tokens) - [Cross-Chain Transfer and Communication](#cross-chain-transfer-and-communication) * [Cross-Chain Transfer](#cross-chain-transfer) * [BC to BSC Architecture](#bc-to-bsc-architecture) * [BSC to BC Architecture](#bsc-to-bc-architecture) * [Timeout and Error Handling](#timeout-and-error-handling) * [Cross-Chain User Experience](#cross-chain-user-experience) * [Cross-Chain Contract Event](#cross-chain-contract-event) - [Staking and Governance](#staking-and-governance) * [Staking on BC](#staking-on-bc) * [Rewarding](#rewarding) * [Slashing](#slashing) - [Relayers](#relayers) * [BSC Relayers](#bsc-relayers) * [Oracle Relayers](#oracle-relayers) - [Outlook](#outlook) # Motivation After its mainnet community [launch](https://www.binance.com/en/blog/327334696200323072/Binance-DEX-Launches-on-Binance-Chain-Invites-Further-Community-Development) in April 2019, [Binance Chain](https://www.binance.org) has exhibited its high speed and large throughput design. Binance Chain’s primary focus, its native [decentralized application](https://en.wikipedia.org/wiki/Decentralized_application) (“dApp”) [Binance DEX](https://www.binance.org/trade), has demonstrated its low-latency matching with large capacity headroom by handling millions of trading volume in a short time. Flexibility and usability are often in an inverse relationship with performance. The concentration on providing a convenient digital asset issuing and trading venue also brings limitations. Binance Chain's most requested feature is the programmable extendibility, or simply the [Smart Contract](https://en.wikipedia.org/wiki/Smart_contract) and Virtual Machine functions. Digital asset issuers and owners struggle to add new decentralized features for their assets or introduce any sort of community governance and activities. Despite this high demand for adding the Smart Contract feature onto Binance Chain, it is a hard decision to make. The execution of a Smart Contract may slow down the exchange function and add non-deterministic factors to trading. If that compromise could be tolerated, it might be a straightforward idea to introduce a new Virtual Machine specification based on [Tendermint](https://tendermint.com/core/), based on the current underlying consensus protocol and major [RPC](https://docs.binance.org/api-reference/node-rpc.html) implementation of Binance Chain. But all these will increase the learning requirements for all existing dApp communities, and will not be very welcomed. We propose a parallel blockchain of the current Binance Chain to retain the high performance of the native DEX blockchain and to support a friendly Smart Contract function at the same time. # Design Principles After the creation of the parallel blockchain into the Binance Chain ecosystem, two blockchains will run side by side to provide different services. The new parallel chain will be called “**Binance Smart Chain**” (short as “**BSC**” for the below sections), while the existing mainnet remains named “**Binance Chain**” (short as “**BC**” for the below sections). Here are the design principles of **BSC**: 1. **Standalone Blockchain**: technically, BSC is a standalone blockchain, instead of a layer-2 solution. Most BSC fundamental technical and business functions should be self-contained so that it can run well even if the BC stopped for a short period. 2. **Ethereum Compatibility**: The first practical and widely-used Smart Contract platform is Ethereum. To take advantage of the relatively mature applications and community, BSC chooses to be compatible with the existing Ethereum mainnet. This means most of the **dApps**, ecosystem components, and toolings will work with BSC and require zero or minimum changes; BSC node will require similar (or a bit higher) hardware specification and skills to run and operate. The implementation should leave room for BSC to catch up with further Ethereum upgrades. 3. **Staking Involved Consensus and Governance**: Staking-based consensus is more environmentally friendly and leaves more flexible option to the community governance. Expectedly, this consensus should enable better network performance over [proof-of-work](https://en.wikipedia.org/wiki/Proof_of_work) blockchain system, i.e., faster blocking time and higher transaction capacity. 4. **Native Cross-Chain Communication**: both BC and BSC will be implemented with native support for cross-chain communication among the two blockchains. The communication protocol should be bi-directional, decentralized, and trustless. It will concentrate on moving digital assets between BC and BSC, i.e., [BEP2](https://github.com/binance-chain/BEPs/blob/master/BEP2.md) tokens, and eventually, other BEP tokens introduced later. The protocol should care for the minimum of other items stored in the state of the blockchains, with only a few exceptions. # Consensus and Validator Quorum Based on the above design principles, the consensus protocol of BSC is to fulfill the following goals: 1. Blocking time should be shorter than Ethereum network, e.g. 5 seconds or even shorter. 2. It requires limited time to confirm the finality of transactions, e.g. around 1-min level or shorter. 3. There is no inflation of native token: BNB, the block reward is collected from transaction fees, and it will be paid in BNB. 4. It is compatible with Ethereum system as much as possible. 5. It allows modern [proof-of-stake](https://en.wikipedia.org/wiki/Proof_of_stake) blockchain network governance. ## Proof of Staked Authority Although Proof-of-Work (PoW) has been recognized as a practical mechanism to implement a decentralized network, it is not friendly to the environment and also requires a large size of participants to maintain the security. Ethereum and some other blockchain networks, such as [MATIC Bor](https://github.com/maticnetwork/bor), [TOMOChain](https://tomochain.com/), [GoChain](https://gochain.io/), [xDAI](https://xdai.io/), do use [Proof-of-Authority(PoA)](https://en.wikipedia.org/wiki/Proof_of_authority) or its variants in different scenarios, including both testnet and mainnet. PoA provides some defense to 51% attack, with improved efficiency and tolerance to certain levels of Byzantine players (malicious or hacked). It serves as an easy choice to pick as the fundamentals. Meanwhile, the PoA protocol is most criticized for being not as decentralized as PoW, as the validators, i.e. the nodes that take turns to produce blocks, have all the authorities and are prone to corruption and security attacks. Other blockchains, such as EOS and Lisk both, introduce different types of [Delegated Proof of Stake (DPoS)](https://en.bitcoinwiki.org/wiki/DPoS) to allow the token holders to vote and elect the validator set. It increases the decentralization and favors community governance. BSC here proposes to combine DPoS and PoA for consensus, so that: 1. Blocks are produced by a limited set of validators 2. Validators take turns to produce blocks in a PoA manner, similar to [Ethereum’s Clique](https://eips.ethereum.org/EIPS/eip-225) consensus design 3. Validator set are elected in and out based on a staking based governance ## Validator Quorum In the genesis stage, a few trusted nodes will run as the initial Validator Set. After the blocking starts, anyone can compete to join as candidates to elect as a validator. The staking status decides the top 21 most staked nodes to be the next validator set, and such an election will repeat every 24 hours. **BNB** is the token used to stake for BSC. In order to remain as compatible as Ethereum and upgradeable to future consensus protocols to be developed, BSC chooses to rely on the **BC** for staking management (Please refer to the below “[Staking and Governance](#staking-and-governance)” section). There is a **dedicated staking module for BSC on BC**. It will accept BSC staking from BNB holders and calculate the highest staked node set. Upon every UTC midnight, BC will issue a verifiable `ValidatorSetUpdate` cross-chain message to notify BSC to update its validator set. While producing further blocks, the existing BSC validators check whether there is a `ValidatorSetUpdate` message relayed onto BSC periodically. If there is, they will update the validator set after an **epoch period**, i.e. a predefined number of blocking time. For example, if BSC produces a block every 5 seconds, and the epoch period is 240 blocks, then the current validator set will check and update the validator set for the next epoch in 1200 seconds (20 minutes). ## Security and Finality Given there are more than ½\*N+1 validators are honest, PoA based networks usually work securely and properly. However, there are still cases where certain amount Byzantine validators may still manage to attack the network, e.g. through the “[Clone Attack](https://arxiv.org/pdf/1902.10244.pdf)”. To secure as much as BC, BSC users are encouraged to wait until receiving blocks sealed by more than ⅔\*N+1 different validators. In that way, the BSC can be trusted at a similar security level to BC and can tolerate less than ⅓\*N Byzantine validators. With 21 validators, if the block time is 5 seconds, the ⅔\*N+1 different validator seals will need a time period of (⅔\*21+1)*5 = 75 seconds. Any critical applications for BSC may have to wait for ⅔\*N+1 to ensure a relatively secure finality. However, besides such arrangement, BSC does introduce **Slashing** logic to penalize Byzantine validators for **double signing** or **inavailability**, which will be covered in the “Staking and Governance” section later. This Slashing logic will expose the malicious validators in a very short time and make the “Clone Attack” very hard or extremely non-beneficial to execute. With this enhancement, ½\*N+1 or even fewer blocks are enough as confirmation for most transactions. ## Reward All the BSC validators in the current validator set will be rewarded with transaction **fees in BNB**. As BNB is not an inflationary token, there will be no mining rewards as what Bitcoin and Ethereum network generate, and the gas fee is the major reward for validators. As BNB is also utility tokens with other use cases, delegators and validators will still enjoy other benefits of holding BNB. The reward for validators is the fees collected from transactions in each block. Validators can decide how much to give back to the delegators who stake their BNB to them, in order to attract more staking. Every validator will take turns to produce the blocks in the same probability (if they stick to 100% liveness), thus, in the long run, all the stable validators may get a similar size of the reward. Meanwhile, the stakes on each validator may be different, so this brings a counter-intuitive situation that more users trust and delegate to one validator, they potentially get less reward. So rational delegators will tend to delegate to the one with fewer stakes as long as the validator is still trustful (insecure validator may bring slashable risk). In the end, the stakes on all the validators will have less variation. This will actually prevent the stake concentration and “winner wins forever” problem seen on some other networks. Some parts of the gas fee will also be rewarded to relayers for Cross-Chain communication. Please refer to the “[Relayers](#relayers)” section below. # Token Economy BC and BSC share the same token universe for BNB and BEP2 tokens. This defines: 1. The same token can circulate on both networks, and flow between them bi-directionally via a cross-chain communication mechanism. 2. The total circulation of the same token should be managed across the two networks, i.e. the total effective supply of a token should be the sum of the token’s total effective supply on both BSC and BC. 3. The tokens can be initially created on BSC in a similar format as ERC20 token standard, or on BC as a BEP2, then created on the other. There are native ways on both networks to link the two and secure the total supply of the token. ## Native Token BNB will run on BSC in the same way as ETH runs on Ethereum so that it remains as “native token” for both BSC and BC. This means, in addition to BNB is used to pay most of the fees on Binance Chain and Binance DEX, BNB will be also used to: 1. pay “fees“ to deploy smart contracts on BSC 2. stake on selected BSC validators, and get corresponding rewards 3. perform cross-chain operations, such as transfer token assets across BC and BSC ### Seed Fund Certain amounts of BNB will be burnt on BC and minted on BSC during its genesis stage. This amount is called “Seed Fund” to circulate on BSC after the first block, which will be dispatched to the initial BC-to-BSC Relayer(described in later sections) and initial validator set introduced at genesis. These BNBs are used to pay transaction fees in the early stage to transfer more BNB from BC onto BSC via the cross-chain mechanism. The BNB cross-chain transfer is discussed in a later section, but for BC to BSC transfer, it is generally to lock BNB on BC from the source address of the transfer to a system-controlled address and unlock the corresponding amount from special contract to the target address of the transfer on BSC, or reversely, when transferring from BSC to BC, it is to lock BNB from the source address on BSC into a special contract and release locked amount on BC from the system address to the target address. The logic is related to native code on BC and a series of smart contracts on BSC. ## Other Tokens BC supports BEP2 tokens and upcoming [BEP8 tokens](https://github.com/binance-chain/BEPs/pull/69), which are native assets transferrable and tradable (if listed) via fast transactions and sub-second finality. Meanwhile, as BSC is Ethereum compatible, it is natural to support ERC20 tokens on BSC, which here is called “**BEP2E**” (with the real name to be introduced by the future BEPs,it potentially covers BEP8 as well). BEP2E may be “Enhanced” by adding a few more methods to expose more information, such as token denomination, decimal precision definition and the owner address who can decide the Token Binding across the chains. BSC and BC work together to ensure that one token can circulate in both formats with confirmed total supply and be used in different use cases. ### Token Binding BEP2 tokens will be extended to host a new attribute to associate the token with a BSC BEP2E token contract, called “**Binder**”, and this process of association is called “**Token Binding**”. Token Binding can happen at any time after BEP2 and BEP2E are ready. The token owners of either BEP2 or BEP2E don’t need to bother about the Binding, until before they really want to use the tokens on different scenarios. Issuers can either create BEP2 first or BEP2E first, and they can be bound at a later time. Of course, it is encouraged for all the issuers of BEP2 and BEP2E to set the Binding up early after the issuance. A typical procedure to bind the BEP2 and BEP2E will be like the below: 1. Ensure both the BEP2 token and the BEP2E token both exist on each blockchain, with the same total supply. BEP2E should have 3 more methods than typical ERC20 token standard: * symbol(): get token symbol * decimals(): get the number of the token decimal digits * owner(): get **BEP2E contract owner’s address.** This value should be initialized in the BEP2E contract constructor so that the further binding action can verify whether the action is from the BEP2E owner. 2. Decide the initial circulation on both blockchains. Suppose the total supply is *S*, and the expected initial circulating supply on BC is *K*, then the owner should lock S-K tokens to a system controlled address on BC. 3. Equivalently, *K* tokens is locked in the special contract on BSC, which handles major binding functions and is named as **TokenHub**. The issuer of the BEP2E token should lock the *K* amount of that token into TokenHub, resulting in *S-K* tokens to circulate on BSC. Thus the total circulation across 2 blockchains remains as *S*. 4. The issuer of BEP2 token sends the bind transaction on BC. Once the transaction is executed successfully after proper verification: * It transfers *S-K* tokens to a system-controlled address on BC. * A cross-chain bind request package will be created, waiting for Relayers to relay. 5. BSC Relayers will relay the cross-chain bind request package into **TokenHub** on BSC, and the corresponding request and information will be stored into the contract. 6. The contract owner and only the owner can run a special method of TokenHub contract, `ApproveBind`, to verify the binding request to mark it as a success. It will confirm: * the token has not been bound; * the binding is for the proper symbol, with proper total supply and decimal information; * the proper lock are done on both networks; 10. Once the `ApproveBind` method has succeeded, TokenHub will mark the two tokens are bounded and share the same circulation on BSC, and the status will be propagated back to BC. After this final confirmation, the BEP2E contract address and decimals will be written onto the BEP2 token as a new attribute on BC, and the tokens can be transferred across the two blockchains bidirectionally. If the ApproveBind fails, the failure event will also be propagated back to BC to release the locked tokens, and the above steps can be re-tried later. # Cross-Chain Transfer and Communication Cross-chain communication is the key foundation to allow the community to take advantage of the dual chain structure: * users are free to create any tokenization, financial products, and digital assets on BSC or BC as they wish * the items on BSC can be manually and programmingly traded and circulated in a stable, high throughput, lighting fast and friendly environment of BC * users can operate these in one UI and tooling ecosystem. ## Cross-Chain Transfer The cross-chain transfer is the key communication between the two blockchains. Essentially the logic is: 1. the `transfer-out` blockchain will lock the amount from source owner addresses into a system controlled address/contracts; 2. the `transfer-in` blockchain will unlock the amount from the system controlled address/contracts and send it to target addresses. The cross-chain transfer package message should allow the BSC Relayers and BC **Oracle Relayers** to verify: 1. Enough amount of token assets are removed from the source address and locked into a system controlled addresses/contracts on the source blockchain. And this can be confirmed on the target blockchain. 2. Proper amounts of token assets are released from a system controlled addresses/contracts and allocated into target addresses on the target blockchain. If this fails, it can be confirmed on source blockchain, so that the locked token can be released back (may deduct fees). 3. The sum of the total circulation of the token assets across the 2 blockchains are not changed after this transfer action completes, no matter if the transfer succeeds or not.  The architecture of cross-chain communication is as in the above diagram. To accommodate the 2 heteroid systems, communication handling is different in each direction. ## BC to BSC Architecture BC is a Tendermint-based, instant finality blockchain. Validators with at least ⅔\*N+1 of the total voting power will co-sign each block on the chain. So that it is practical to verify the block transactions and even the state value via **Block Header** and **Merkle Proof** verification. This has been researched and implemented as “**Light-Client Protocol**”, which are intensively discussed in [the Ethereum](https://github.com/ethereum/wiki/wiki/Light-client-protocol) community, studied and implemented for [Cosmos inter-chain communication](https://github.com/cosmos/ics/blob/a4173c91560567bdb7cc9abee8e61256fc3725e9/spec/ics-007-tendermint-client/README.md). BC-to-BSC communication will be verified in an “**on-chain light client**” implemented via BSC **Smart Contracts** (some of them may be **“pre-compiled”**). After some transactions and state change happen on BC, if a transaction is defined to trigger cross-chain communication,the Cross-chain “**package**” message will be created and **BSC Relayers** will pass and submit them onto BSC as data into the "build-in system contracts". The build-in system contracts will verify the package and execute the transactions if it passes the verification. The verification will be guaranteed with the below design: 1. BC blocking status will be synced to the light client contracts on BSC from time to time, via block header and pre-commits, for the below information: * block and app hash of BC that are signed by validators * current validatorset, and validator set update 2. the key-value from the blockchain state will be verified based on the Merkle Proof and information from above #1. After confirming the key-value is accurate and trustful, the build-in system contracts will execute the actions corresponding to the cross-chain packages. Some examples of such packages that can be created for BC-to-BSC are: 1. Bind: bind the BEP2 tokens and BEP2E 2. Transfer: transfer tokens after binding, this means the circulation will decrease (be locked) from BC and appear in the target address balance on BSC 3. Error Handling: to handle any timeout/failure event for BSC-to-BC communication 4. Validatorset update of BSC To ensure no duplication, proper message sequence and timely timeout, there is a “Channel” concept introduced on BC to manage any types of the communication. For relayers, please also refer to the below “Relayers” section. ## BSC to BC Architecture BSC uses Proof of Staked Authority consensus protocol, which has a chance to fork and requires confirmation of more blocks. One block only has the signature of one validator, so that it is not easy to rely on one block to verify data from BSC. To take full advantage of validator quorum of BC, an idea similar to many [Bridge ](https://github.com/poanetwork/poa-bridge)or Oracle blockchains is adopted: 1. The cross-chain communication requests from BSC will be submitted and executed onto BSC as transactions. The execution of the transanction wil emit `Events`, and such events can be observed and packaged in certain “**Oracle**” onto BC. Instead of Block Headers, Hash and Merkle Proof, this type of “Oracle” package directly contains the cross-chain information for actions, such as sender, receiver and amount for transfer. 2. To ensure the security of the Oracle, the validators of BC will form anothe quorum of “**Oracle Relayers**”. Each validator of the BC should run a **dedicated process** as the Oracle Relayer. These Oracle Relayers will submit and vote for the cross-chain communication package, like Oracle, onto BC, using the same validator keys. Any package signed by more than ⅔\*N+1 Oracle Relayers’ voting power is as secure as any block signed by ⅔\*N+1 of the same quorum of validators’ voting power. By using the same validator quorum, it saves the light client code on BC and continuous block updates onto BC. Such Oracles also have Oracle IDs and types, to ensure sequencing and proper error handling. ## Timeout and Error Handling There are scenarios that the cross-chain communication fails. For example, the relayed package cannot be executed on BSC due to some coding bug in the contracts. **Timeout and error handling logics are** used in such scenarios. For the recognizable user and system errors or any expected exceptions, the two networks should heal themselves. For example, when BC to BSC transfer fails, BSC will issue a failure event and Oracle Relayers will execute a refund on BC; when BSC to BC transfer fails, BC will issue a refund package for Relayer to relay in order to unlock the fund. However, unexpected error or exception may still happen on any step of the cross-chain communication. In such a case, the Relayers and Oracle Relayers will discover that the corresponding cross-chain channel is stuck in a particular sequence. After a Timeout period, the Relayers and Oracle Relayers can request a “SkipSequence” transaction, the stuck sequence will be marked as “Unexecutable”. A corresponding alerts will be raised, and the community has to discuss how to handle this scenario, e.g. payback via the sponsor of the validators, or event clear the fund during next network upgrade. ## Cross-Chain User Experience Ideally, users expect to use two parallel chains in the same way as they use one single chain. It requires more aggregated transaction types to be added onto the cross-chain communication to enable this, which will add great complexity, tight coupling, and maintenance burden. Here BC and BSC only implement the basic operations to enable the value flow in the initial launch and leave most of the user experience work to client side UI, such as wallets. E.g. a great wallet may allow users to sell a token directly from BSC onto BC’s DEX order book, in a secure way. ## Cross-Chain Contract Event Cross-Chain Contract Event (CCCE) is designed to allow a smart contract to trigger cross-chain transactions, directly through the contract code. This becomes possible based on: 1. Standard system contracts can be provided to serve operations callable by general smart contracts; 2. Standard events can be emitted by the standard contracts; 3. Oracle Relayers can capture the standard events, and trigger the corresponding cross-chain operations; 4. Dedicated, code-managed address (account) can be created on BC and accessed by the contracts on the BSC, here it is named as **“Contract Address on BC” (CAoB)**. Several standard operations are implemented: 1. BSC to BC transfer: this is implemented in the same way as normal BSC to BC transfer, by only triggered via standard contract. The fund can be transferred to any addresses on BC, including the corresponding CAoB of the transfer originating contract. 2. Transfer on BC: this is implemented as a special cross-chain transfer, while the real transfer is from **CAoB** to any other address (even another CAoB). 3. BC to BSC transfer: this is implemented as two-pass cross-chain communication. The first is triggered by the BSC contract and propagated onto BC, and then in the second pass, BC will start a normal BC to BSC cross-chain transfer, from **CAoB** to contract address on BSC. A special note should be paid on that the BSC contract only increases balance upon any transfer coming in on the second pass, and the error handling in the second pass is the same as the normal BC to BSC transfer. 4. IOC (Immediate-Or-Cancel) Trade Out: the primary goal of transferring assets to BC is to trade. This event will instruct to trade a certain amount of an asset in CAoB into another asset as much as possible and transfer out all the results, i.e. the left the source and the traded target tokens of the trade, back to BSC. BC will handle such relayed events by sending an “Immediate-Or-Cancel”, i.e. IOC order onto the trading pairs, once the next matching finishes, the result will be relayed back to BSC, which can be in either one or two assets. 5. Auction Trade Out: Such event will instruct BC to send an auction order to trade a certain amount of an asset in **CAoB** into another asset as much as possible and transfer out all the results back to BSC at the end of the auction. Auction function is upcoming on BC. There are some details for the Trade Out: 1. both can have a limit price (absolute or relative) for the trade; 2. the end result will be written as cross-chain packages to relay back to BSC; 3. cross-chain communication fees may be charged from the asset transferred back to BSC; 4. BSC contract maintains a mirror of the balance and outstanding orders on CAoB. No matter what error happens during the Trade Out, the final status will be propagated back to the originating contract and clear its internal state. With the above features, it simply adds the cross-chain transfer and exchange functions with high liquidity onto all the smart contracts on BSC. It will greatly add the application scenarios on Smart Contract and dApps, and make 1 chain +1 chain > 2 chains. # Staking and Governance Proof of Staked Authority brings in decentralization and community involvement. Its core logic can be summarized as the below. You may see similar ideas from other networks, especially Cosmos and EOS. 1. Token holders, including the validators, can put their tokens “**bonded**” into the stake. Token holders can **delegate** their tokens onto any validator or validator candidate, to expect it can become an actual validator, and later they can choose a different validator or candidate to **re-delegate** their tokens<sup>1</sup>. 2. All validator candidates will be ranked by the number of bonded tokens on them, and the top ones will become the real validators. 3. Validators can share (part of) their blocking reward with their delegators. 4. Validators can suffer from “**Slashing**”, a punishment for their bad behaviors, such as double sign and/or instability. 5. There is an “**unbonding period**” for validators and delegators so that the system makes sure the tokens remain bonded when bad behaviors are caught, the responsible will get slashed during this period. ## Staking on BC Ideally, such staking and reward logic should be built into the blockchain, and automatically executed as the blocking happens. Cosmos Hub, who shares the same Tendermint consensus and libraries with Binance Chain, works in this way. BC has been preparing to enable staking logic since the design days. On the other side, as BSC wants to remain compatible with Ethereum as much as possible, it is a great challenge and efforts to implement such logic on it. This is especially true when Ethereum itself may move into a different Proof of Stake consensus protocol in a short (or longer) time. In order to keep the compatibility and reuse the good foundation of BC, the staking logic of BSC is implemented on BC: 1. The staking token is BNB, as it is a native token on both blockchains anyway 2. The staking, i.e. token bond and delegation actions and records for BSC, happens on BC. 3. The BSC validator set is determined by its staking and delegation logic, via a staking module built on BC for BSC, and propagated every day UTC 00:00 from BC to BSC via Cross-Chain communication. 4. The reward distribution happens on BC around every day UTC 00:00. ## Rewarding Both the validator update and reward distribution happen every day around UTC 00:00. This is to save the cost of frequent staking updates and block reward distribution. This cost can be significant, as the blocking reward is collected on BSC and distributed on BC to BSC validators and delegators. (Please note BC blocking fees will remain rewarding to BC validators only.) A deliberate delay is introduced here to make sure the distribution is fair: 1. The blocking reward will not be sent to validator right away, instead, they will be distributed and accumulated on a contract; 2. Upon receiving the validator set update into BSC, it will trigger a few cross-chain transfers to transfer the reward to custody addresses on the corresponding validators. The custody addresses are owned by the system so that the reward cannot be spent until the promised distribution to delegators happens. 3. In order to make the synchronization simpler and allocate time to accommodate slashing, the reward for N day will be only distributed in N+2 days. After the delegators get the reward, the left will be transferred to validators’ own reward addresses. ## Slashing Slashing is part of the on-chain governance, to ensure the malicious or negative behaviors are punished. BSC slash can be submitted by anyone. The transaction submission requires **slash evidence** and cost fees but also brings a larger reward when it is successful. So far there are two slashable cases. ### Double Sign It is quite a serious error and very likely deliberate offense when a validator signs more than one block with the same height and parent block. The reference protocol implementation should already have logic to prevent this, so only the malicious code can trigger this. When Double Sign happens, the validator should be removed from the Validator **Set** right away. Anyone can submit a slash request on BC with the evidence of Double Sign of BSC, which should contain the 2 block headers with the same height and parent block, sealed by the offending validator. Upon receiving the evidence, if the BC verifies it to be valid: 1. The validator will be removed from validator set by an instance BSC validator set update Cross-Chain update; 2. A predefined amount of BNB would be slashed from the **self-delegated** BNB of the validator; Both validator and its delegators will not receive the staking rewards. 3. Part of the slashed BNB will allocate to the submitter’s address, which is a reward and larger than the cost of submitting slash request transaction 4. The rest of the slashed BNB will allocate to the other validators’ custody addresses, and distributed to all delegators in the same way as blocking reward. ### Inavailability The liveness of BSC relies on everyone in the Proof of Staked Authority validator set can produce blocks timely when it is their turn. Validators can miss their turn due to any reason, especially problems in their hardware, software, configuration or network. This instability of the operation will hurt the performance and introduce more indeterministic into the system. There can be an internal smart contract responsible for recording the missed blocking metrics of each validator. Once the metrics are above the predefined threshold, the blocking reward for validator will not be relayed to BC for distribution but shared with other better validators. In such a way, the poorly-operating validator should be gradually voted out of the validator set as their delegators will receive less or none reward. If the metrics remain above another higher level of threshold, the validator will be dropped from the rotation, and this will be propagated back to BC, then a predefined amount of BNB would be slashed from the **self-delegated** BNB of the validator. Both validators and delegators will not receive their staking rewards. ### Governance Parameters There are many system parameters to control the behavior of the BSC, e.g. slash amount, cross-chain transfer fees. All these parameters will be determined by BSC Validator Set together through a proposal-vote process based on their staking. Such the process will be carried on BC, and the new parameter values will be picked up by corresponding system contracts via a cross-chain communication. # Relayers Relayers are responsible to submit Cross-Chain Communication Packages between the two blockchains. Due to the heterogeneous parallel chain structure, two different types of Relayers are created. ## BSC Relayers Relayers for BC to BSC communication referred to as “**BSC Relayers**”, or just simply “Relayers”. Relayer is a standalone process that can be run by anyone, and anywhere, except that Relayers must register themselves onto BSC and deposit a certain refundable amount of BNB. Only relaying requests from the registered Relayers will be accepted by BSC. The package they relay will be verified by the on-chain light client on BSC. The successful relay needs to pass enough verification and costs gas fees on BSC, and thus there should be incentive reward to encourage the community to run Relayers. ### Incentives There are two major communication types: 1. Users triggered Operations, such as `token bind` or `cross chain transfer`. Users must pay additional fee to as relayer reward. The reward will be shared with the relayers who sync the referenced blockchain headers. Besides, the reward won't be paid the relayers' accounts directly. A reward distribution mechanism will be brought in to avoid monopolization. 2. System Synchronization, such as delivering `refund package`(caused by failures of most oracle relayers), special blockchain header synchronization(header contains BC validatorset update), BSC staking package. System reward contract will pay reward to relayers' accounts directly. If some Relayers have faster networks and better hardware, they can monopolize all the package relaying and leave no reward to others. Thus fewer participants will join for relaying, which encourages centralization and harms the efficiency and security of the network. Ideally, due to the decentralization and dynamic re-election of BSC validators, one Relayer can hardly be always the first to relay every message. But in order to avoid the monopolization further, the rewarding economy is also specially designed to minimize such chance: 1. The reward for Relayers will be only distributed in batches, and one batch will cover a number of successful relayed packages. 2. The reward a Relayer can get from a batch distribution is not linearly in proportion to their number of successful relayed packages. Instead, except the first a few relays, the more a Relayer relays during a batch period, the less reward it will collect. ## Oracle Relayers Relayers for BSC to BC communication are using the “Oracle” model, and so-called “**Oracle Relayers**”. Each of the validators must, and only the ones of the validator set, run Oracle Relayers. Each Oracle Relayer watches the blockchain state change. Once it catches Cross-Chain Communication Packages, it will submit to vote for the requests. After Oracle Relayers from ⅔ of the voting power of BC validators vote for the changes, the cross-chain actions will be performed. Oracle Replayers should wait for enough blocks to confirm the finality on BSC before submitting and voting for the cross-chain communication packages onto BC. The cross-chain fees will be distributed to BC validators together with the normal BC blocking rewards. Such oracle type relaying depends on all the validators to support. As all the votes for the cross-chain communication packages are recorded on the blockchain, it is not hard to have a metric system to assess the performance of the Oracle Relayers. The poorest performer may have their rewards clawed back via another Slashing logic introduced in the future. # Outlook It is hard to conclude for Binance Chain, as it has never stopped evolving. The dual-chain strategy is to open the gate for users to take advantage of the fast transferring and trading on one side, and flexible and extendable programming on the other side, but it will be one stop along the development of Binance Chain. Here below are the topics to look into so as to facilitate the community better for more usability and extensibility: 1. Add different digital asset model for different business use cases 2. Enable more data feed, especially DEX market data, to be communicated from Binance DEX to BSC 3. Provide interface and compatibility to integrate with Ethereum, including its further upgrade, and other blockchain 4. Improve client side experience to manage wallets and use blockchain more conveniently ------ [1]: BNB business practitioners may provide other benefits for BNB delegators, as they do now for long term BNB holders.
BlockchainLabs
Reserve funds will be used to increase NAV by various means, including but not limited to investing in other coins, by trade or buy back. ICO: Crowdfunding & Price Discovery: Total BTC raised during the crowdfunding will act as the price discovery mechanism. 1,000,000 Salus will be distributed among investors based on percentage invested. My share of SLS will based on total value of coins listed within Kick Starter and Trading Coins at the end of ICO. Crowdfunding phase extended to 1-18-2016 The first 10 supporters/participants will receive 10% bonus SaluS coin after distribution is over. The next 10 participants will receive 5% extra SLS. Participation requires minimum of 0.01 BTC. Crowdfunding Address: Quote 1LJPiY3vUeN5SkLY9k8qBHeMdBeXJNNtBe and Form:http://goo.gl/forms/0cMMy02srh Must be completed. Make sure to send from an address you control, not an exchange. Total Collected:https://blockchain.info/address/1LJPiY3vUeN5SkLY9k8qBHeMdBeXJNNtBe Or Use escrow Escrow Instructions: https://bitcointalk.org/index.php?topic=1317448.msg13471975#msg13471975 Kick Starter Coins: HyperStake RateCoin AudioCoin Noble Redd Viral PebbleCoin PeerCoin HYP XRA ADC NOBL RDD VIRAL XPB PPC 7,000,000: 4,000,000: 20,000,000: 70,000,000: 20,000,000: 100,000: 150,000: 100: Trading coins: BitShare Burst NXT SiaCoin XEM Dashcoin Horizon Florin Quatloo Monero BTS BURST NXT SIA XEM DSH HZ FLO QTL XMR 50,000 5,000,000 100,000 20,000,000 1,000,000 100,000 500,000 100,000 10,000 200 Cloud Staking Service: - Coin Request Form - http://goo.gl/forms/30P0We6pke HyperStake RateCoin AudioCoin Noble Redd Viral RUBY HYP XRA ADC NOBL RDD VIRAL RBY http://goo.gl/forms/Yyaub9a5aX http://goo.gl/forms/161pSKoC6Y http://goo.gl/forms/M1AG1YCinF http://goo.gl/forms/qXMhkzxdCn http://goo.gl/forms/LrAAE6kVFM http://goo.gl/forms/ZF1z6MgRYN http://goo.gl/forms/FV98Be3ZPq AFFILIATE PROGRAMS: Affiliate Program Submission form-http://goo.gl/forms/6bujSMhkgM Exchanges: Coinbase localbitcoins Bleutrade 1Broker https://www.coinbase.com/join/ https://localbitcoins.com/? https://bleutrade.com/sign_up/ https://1broker.com/m/r.php Mining: MinerGate LTCrabbit CoinKing.io https://minergate.com/ https://www.ltcrabbit.com/ http://coinking.io/? Hosting/VPS/VPN/Domains: NameCheap BitDomain.BIZ BitVPN.org http://www.namecheap.com/? http://www.bitdomain.biz/? https://bitvpn.org/? Gaming: BC Casino Directbet.eu Bitcasino.io Betterbet.io DigiByte https://www.bc-casino.com/? http://www.directbet.eu? http://coinpoker.io? https://betterbets.io/? http://www.digibytegaming.com/users/sign_up? Interest paying Wallets BW.com https://bw.com/ MISC. cointracking.info FreeDogeCoin FreeBitcoin http://cointracking.info http://freedoge.co.in/? http://freebitco.in/? Consumer Goods: Compiling List. PM me on BCT, Slack or IRC if you have any question, concerns or suggestions. Special Thanks: Syntaks - wallet Presstab - Block Explorer/Code review SebastianJu - Escrow Stoner19 - Feedback/Pool/All around help. iDunk - Win64 wallet Billotronic - MAC wallet ozmaster - Advice/Coinbar Listing Drew - IRC Bot And everyone else that has been supportive of this project.| Coin Specifications Coin Name - SaluS Ticker - SLS Annual Interest - 1% Supply - 1,000,000 Min stake age - 8 hours Max stake age - No Max age SaluS Fund Transaction Fee - .0001 Block Time - 3Min Block maturity - 5 p2p Port - 22534 rpc port - 22530 50 confirm stake minimum for eligibility (Wallet was developed by Syntaks)- https://bitcointalk.org/index.php?action=profile;u=175669 (BlockExplorer provided by Presstab)- http://www.presstab.pw/ Logo- http://saluscoin.info/pics/sls.png Source- https://github.com/saluscoin/SaluS Wallet - Win 32 | Win 64 | Raspi | Mac Block Explorer- http://sls.presstab.pw Nodes:http://www.presstab.pw/phpexplorer/SLS/nodes.php Exchanges: Bittrex - https://stage.bittrex.com/Market/Index?MarketName=BTC-SLS YoBit - https://yobit.net/en/trade/SLS/BTC Vote: - https://c-cex.com/?id=vote&coin=sls PM me if interest in adding SLS to your exchange Faucet: http://crypto-faucet.eu/faucets/sls About: An experimental Coin aimed to increase Net Asset Value (NAV) by various means. Kick Starter Coins: Below is a list of coins that will be included during the initial phase of this project. Listed coins will stake on behalf of SaluS project, stakes will be sold on exchanges to increase BTC reserve. Cloud Staking Service: Fees will be 5% of the stakes, however, the advantages listed below easily outweigh the fees. 1) Experience, keen knowledge of Coin specs. 2) Customized wallets for optimum stacking 3) Staking Advantage, (whaling weight/diff), Research for Optimum block size. 4) 24/7 Uptime, No Hassle, no worry, No Resource staking. Affiliate programs: All profit made from affiliate programs will go to SaluS reserve to increase NAV. If you hold Salus coin and would like to help your investment grow, sign up for the services listed below using provided links. Foundation Transaction Fee - .0001 This is a separate TX fee of .0001 that goes to a specific Address, called the Foundation Transaction fee. This fee is in place for couple of reasons. 1) To control inflation since the supply is set to increase by 1% annually. 2) Resold to increase the reserve. Mining Guaranteed Minimum CPU hash rate of 1000H/s Would encourage everyone invested in this coin with CPU power to spare, to click on the link below. link will be up soon. Traders Advantage: Top 10 Claimed Addresses on the rich list will have access to all trades and portfolio activity/status in near real time. There will be a fee for those who are not on top 10 list but would like to have access to such information. All fees will be added to the reserve fund. MultiPool: http://hashgoal.com/ "Holy Grail" - Financial Instrument Will not disclose any information about this project at this time, but I do believe this will take SaluS to a whole new level if it gets off the ground. (details on this project will be announced as soon as development officially starts)
BlockchainLabs
Pebblecoin UPDATE 2015/12/31: Version 0.4.4.1 is now out. The major change is optimizing the daemon to use less RAM. It no longer keeps all the blocks, which are rarely needed, in RAM, and so RAM usage has decreased from around 2 gigabytes, to under 200 megabytes. Mac binaries are also now available. The new wallet is compatible with the old wallet - simply turn off the old wallet, and start the new wallet, and the blockchain will update automatically to use less RAM. Code: Release Notes 0.4.4.1 - (All) Fix blockchain RAM usage, from almost 2 GB to less than 200 MB - Seamless blockchain conversion on first run with new binaries - (Qt) Fix high CPU usage - (Qt) Fix sync indicator (# of total blocks) - (Mac) Mac binaries - Technical Notes: - (All) Blockchain disk-backed storage with sqlite3 and stxxl - (Mac) Fix mac compilation - (All) Update build files & instructions for linux, mac, windows - (All) Remove unused protobuf and OpenSSL dependencies for Qt wallet - (Tests) Fix valgrind errors - (Tests) Use local directory for blockchain instead of default directory - (Tests) Run tests on Windows if using new enough MSVC LINKS: Windows 64-bit: https://www.dropbox.com/s/b4kubwwnb4t7o4w/pebblecoin-all-win32-x64-v0.4.4.1.zip?dl=0 Mac 64-bit: https://www.dropbox.com/s/uoy9z1oxu4x53cv/pebblecoin-all-mac-x64-v0.4.4.1.tar.gz?dl=0 Linux 64-bit: https://www.dropbox.com/s/jq3h3bc29jmndks/pebblecoin-all-linux-x64-v0.4.4.1.tar.gz?dl=0 Exchange: https://poloniex.com/exchange#btc_xpb . Source: https://github.com/xpbcreator/pebblecoin/ CONTACT: xpbcreator@torguard.tg IRC: irc.freenode.net, #pebblecoin UPDATE 2015/06/08: Version 0.4.3.1 is now out. This is a minor, mostly bug-fix release. Work continues on the next major release which will bring us user-created currencies and user-graded contracts. Release notes: Code: Release Notes 0.4.3.1 - RPC calls for DPOS: - getdelegateinfos RPC call - get kimageseqs RPC call - block header contains signing_delegate_id - fix checkpoint rollback bug - fix inability to send coins if voting history was lost UPDATE 2015/05/04: Version 0.4.2.2 is now out. This is a bug-fix/cosmetic release. Release notes: Payment ID support Windows installer Logos updated Improved DPOS tab Sync issues fully fixed Fix rare crash bug Fix min out 0 bug Fix debit display Fix GUI not updating Updated hard-coded seed nodes UPDATE 2015/04/24: The switch-over to DPOS has succeeded without a hitch! DPOS blocks are being signed as we speak, at the far faster pace of 15 seconds per block. This marks the start of a new era for Pebblecoin. UPDATE 2015/04/21: Congratulations to the first registered delegate! This indicates the start of the forking change so everybody please update your daemons if you haven't already. To promote the coin and encourage people to become delegates, we've come up with an incentive scheme. First, we'll send a free 100 XPB to anybody who PMs me their public address, for people to play around with and to start using the coin. Second, once DPOS starts, for the first month of DPOS I'll send an extra 0.5 XPB to the signing delegate for every block they process. This is on top of the usual transaction fees they will receive. This is to encourage more people to become delegates at this important phase of the coin. UPDATE 2015/04/19: All went well on the testnet release, so after a few further minor modifications, we are releasing version 0.4.1.2 to the public. This is a forking change, so please update your clients and servers (links below). At block 83120, sometime on April 21st, registration for DPOS delegates will begin. At block 85300, sometime on April 24th, the network will switch over to DPOS. As with the testnet, to become a delegate and receive block fees for securing the network, just turn on your wallet, register to be a delegate (5 XPB fee), and then leave your wallet on. It will sign the blocks when it is your turn. While Roman works on the next phase of the release - introducing subcurrencies - I will be fixing up some loose ends on the wallet, adding payment ID support, etc. This is truly an exciting time for Pebblecoin. RELEASE NOTES: All clients adjust internal clocks using ntp (client list in src/common/ntp_time.cpp) Added testnet support DPOS registration starts Block 83120 (~April 21st) DPOS phase starts Block 85300 (~April 24th) Default fee bumped to 0.10 XPB Low-free transactions no longer get relayed by default Significantly improved wallet sync Checkpoint at Block 79000 TOTAL CURRENT COINS: Available at this link. BLOCK TARGET TIME: 2 minutes EXPECTED EMISSION: At Block 3600 (End of Day 5): ~78 XPBs At Block 6480 (End of Day 9): ~758 XPBs At Block 9360 (End of Day 13): 6,771.0 XPBs At Block 12240 (End of Day 17): ~61,000 XPBs At Block 15120 (End of Day 21): ~550,000 XPBs, start of regular 300/block emission At Block 21900 (End of Month 1): ~2,600,000 XPBs, 300/block At Block 43800 (End of Month 2): ~9,150,000 XPBs, 300/block At Block 85300 (End of POW phase): ~21,500,300 XPBs. UPDATE: The Pebblecoin Pool is now live! Instructions: Download the linux miner and run it: ./minerd -o stratum+tcp://69.60.113.21:3350 -u YOUR_WALLET_ADDRESS -p x UPDATE: The Pebblecoin wallet is now live! There have been thousands of attempts at alternative currencies in the community. Many are 100% copies of existing blockchains with a different name. Some are very slight variations with no significant differences. From recent history it is apparent the only realistic chance for viability of a new currency is one that is innovation and continued support and development. The bitcoin community for good reason has shown interest in currencies that provide privacy of transactions, several currencies such as darkcoin, have become popular based on this desire. The best technology for privacy is cryptonote although for a variety of reasons there hasnt been much development for ease of use, and as a result there has not been significant adoption. Pebblecoin (XPB) is a cryptonote based coin with improvements and changes in some areas, and the promise of development in others. I invite developers to work on this technology with me. There is no premine, any tips or support of any developer including myself will be completely voluntary. These are the following areas which I have determined needs changes/updates: I welcome suggestions, and am interested what else I can try to improve. 1) New Mining algorithm (active) A mining algorithm is either susceptible to ASIC development or to being botnetted, meaning it is either more efficient to have a centralized mining entity (as is the case with bitcoin) or to have an algorithm that requires a real CPU, in which case botnets become very attractive. To my knowledge there does not exist a blockchain that attempts to solve both problems, by having an algorithm that only works on a general purpose computer and is difficult to botnet. Cryptonote coins currently are primarily mined with botnets. Boulderhash is a new mining algorithm requiring 13 GB RAM, nearly eliminating all possible zombie (botnet controlled) computers from mining. Most infected computers in the world do not have 13 GB available, so an algorithm that requires that much RAM severely limits the productivity of a botnet. 13 GB also makes ASICs cost prohibitive, and the current GPUs do not have that much RAM. What's left is general purpose computers as was the original intent of bitcoin's mining process. 2) Distribution of coins (active) It is very common in the launch of a new cryptocurrency the distribution algorithm heavily is weighted towards the very early adopters. Such distribution is designed to give a massive advantage to people who are fully prepared to mine at launch, with a very large difference shortly after sometimes a few days later. If the point of mining is to both secure the network and fairly distribute coins a gradual build up of rewards makes more sense, with no drop off in mining rewards. At a standard block reward of 300, at launch each block will reward 0.3 coins leading up to 3, 30, and finally the standard reward of 300 which will be the standard unchanging reward from that point. It will take approximately 3 weeks for the block reward of 300 to be reached. 3) GUI Software (active) There are no current cryptonote coins that have a downloadable GUI, which makes the user experience much worse than that of bitcoin. It is hard to achieve signficant adoption with a command line interface. The very first update had the exact GUI written for bitcoin fully working with Pebblecoin. The GUI was released on Jan 19, before the full 300 XPB reward was awarded for winning the block. 4) IRC Chat support embedded in Client GUI (active) For user support, and to talk to core developers message boards such as Bitcointalk and reddit are primarily used. I have embedded an IRC client in the GUI and be available at set hours for any kind of support. 5) Address aliasing (to be worked on) Just as a user visiting google does not need to know the ip address, similarly an address should have the ability to have an associated userid. If I ask a friend to send me pebblecoins it would be easier to tell him send it to @myuserid rather than a very long address or scanning a QR code. There should be a way of registering a userid on the blockchain that will permanently translate to a pebblecoin addresss. QT INSTRUCTIONS: Download the package for your respective platform Run the Qt executable. The software will generate a new wallet for you and use a default folder: ~/.pebblecoin on Linux and %appdata%\pebblecoin on Windows. To use an existing wallet, copy the wallet.keys file into the default folder. To use a different data directory and/or wallet file, run the software like so: ./pebblecoin-qt --data-dir <DataDir> --wallet-file <FileName>. To enable mining, run the start_mining_NEEDS_13GB_RAM.bat batch file. Or run the qt wallet with the --enable-boulderhash command line option, or put enable-boulderhash=1 into the config file. It will start mining to the wallet address. To change the number of mining threads (13GB required per thread), do --mining-threads <NumThreads> or edit the batch file. DAEMON + SIMPLEWALLET INSTRUCTIONS: Download the package, run: ./pebblecoind --data-dir pebblecoin_data Once the daemon finished syncing, run the simplewallet: ./simplewallet POOL INSTRUCTIONS: Download the miner binary for your platform. Run the miner using a wallet address gotten from simplewallet or the Qt Wallet: Code: minerd -o stratum+tcp://69.60.113.21:3350 -u YOUR_WALLET_ADDRESS -p x [/li] DEV WALLET (for donations): PByFqCfuDRUPVsNrzrUXnuUdF7LpXsTTZXeq5cdHpJDogbJ8EBXopciN7DmQiGhLEo5ArA7dFqGga2A AhbRaZ2gL8jjp9VmYgk
BlockchainLabs
Start Of Efficient Digital HIcoin HICoin has many features and advantages. It has an ideal HIcoin to transfer anywhere, anytime money to friends HIcoin is a Pos(proof-of-stake) Internet currency that enables instant, near-zero cost payments to anyone in the world. HIcoin’s Key Features HIcoin features faster transaction confirmation times and improved storage efficiency than the leading math-based currency. HIcoin is open-source; its design is public, nobody owns or controls HIcoin and everyone can take part. HIcoin network does not require the use of large-scale, specialized hardware operations. HIcoin is far more energy-efficient than traditional digital currency networks. Wallet encryption allows you to secure your wallet, so that you can view transactions and your account balance, but are required to enter your password before spending HIcoins. This provides protection from wallet-stealing viruses and trojans as well as a sanity check before sending payments. Look for hicoin in more point of sale applications soon with recent addition to merchant services. SPECIFICATIONS / POS INTEREST: PoS (Proof-of-Stake) 5% yearly (from non-reserved wallet balance) / ALGORITHM: Scrypt / SYMBOL: XHI / BLOCK TIME: 60 sec / LAST POW BLOCK: 3600 / TOTAL MONEY SUPPLY: 10,000,000,000 XHI / BLOCK REWARD: BLOCKS 1-10 (premine): each 1,000,000,000 XHI / BLOCKS 11~3600: 100 XHI / COIN POS AGE: Min. 1 hour / Max. unlimited / RPC PORT: 35288 (testnet 45288 ) / P2P PORT: 35289 (testnet 45289 ) / Coin maturity: 100 confirmations | KEY FEATURES Security and control over your money secure against the attacks other digital currencies face due to their reliability on large-scale mining operations Fast international payments HICoin is the ideal digital currency for face to face transactions and all applications that value speed. 1% compound interest yearly You will earn rewards every few days, depending on the size of your holdings, adding up to 5% interest yearly. FEATURES MESSAGES Big Miners Back Bitcoin Classic As Scaling Debate Evolves Following a months-long debate on how best to scale the bitcoin network to accommodate a greater number of transactions, bitcoin mining firms are voicing their support for a newly introduced proposal called Bitcoin Classic. Though a new entrant to the debate, Bitcoin Classic so far has the support of bitcoin developers including former Bitcoin Core Read More admin 01/19/2016 - 5 Must-Read Excerpts from the UK Government’s Blockchain Report “The progress of mankind is marked by the rise of new technologies and the human ingenuity they unlock.” That’s the glowing foreword to a new report on blockchain and distributed ledger tech issued by the UK government’s Chief Scientific Adviser this week. Taking a positive outlook on the emerging technology, the document recommends a broad government initiative to develop and demonstrate blockchain and distributed Read More admin 01/19/2016 - Is Digital Asset’s $50 Million Funding a Blow to Bitcoin? VCs Weigh In Founded in 2014 and led by CEO and ex-JP Morgan executive Blythe Masters, Digital Asset Holdings had long been the subject of speculation that suggested that, despite its high-profile leadership, the startup was having difficulties raising an initial funding round. All that uncertainty was laid to rest last week, however, when Digital Asset silenced rumors Read More admin 01/12/2016 0 Our Team Project Manager TIMO SPRAY Business Development JASON LANE Art Director TONYA GARCIA Account Manager ASHLEY SUJAN It Has An Ideal Hicoin To Transfer Anywhere, Anytime Money To Friends. WALLET
NourelhoudaAbdellaoui
Secure Donation Project based on truffle /metamask/ganache Your guide to build a project donation based on blockchain in order to ensure the traceability and the security of your money donation. Steps : Step 1:Setup your IDE coding in my case i choose VS code 1-I install the extension of truffle on VS Code .and I learn the basics of truffle thanks to the official site : https://trufflesuite.com/docs/truffle/ by the way truffle is just a development environment to code and compile your smart contract and is testing framework for blockchains using the ethereum virtual machine .So let’s take the first step : I created a folder named Nour project using this command : mkdir NourProject and also inside it i created 2 other folders :mkdir frontend and mkdir Blockchain Step2:Start with truffle so now let’s create our truffle project inside Nourproject/Blockchain thanks to the command truffle init Now let’s create our smart contract named Donation.sol in Nourproject/Blockchain/contracts and in direction Nourproject/Blockchain/migration/Donation.js fo deploying later your smart contract on ganache we will use this fil!e .js So our smart Contract looks like: //SPDX-License-Identifier:MIT pragma solidity ^0.8.0; //so contract Donation{ //struct :define your type Donor //inside struct you can grouping your different information that you wanna track it struct Donor{ //uint (only integer without minus) uint id ;//id of donor string name;// the name of donor uint256 amount;// the amount of donor address sender_address;//Donprs wallet address } uint256 id=0; //Mapping is Mapping is a reference type as arrays and structs as dictionnary in python is composed essentially by key =>value mapping(uint=>Donor)public sender; //function to add another donor to take a place //payble is function its role to recieve ETH from donors in oder to store //donors data and the amount paid function addDonor(string memory name)public payable { id+=1; sender[id]=Donor(id,name,msg.value,msg.sender); } So now let’s how to complelete the donation.js in migration so after coding our smart contract we have install ganache thanks to this link: https://trufflesuite.com/ganache/ so now let’s compile the smart contract thans to this command truffle compile before we deploy it into ganache we have to add the project into ganache now let’s relate ganache to truffle test so let’s deploy it into the ganache (local blockchain test ): truffle migrate Step3 :Frontend part this part based on html /css/js So in this part just we use the basic tools of html/css/js as u see here in the image bellow : so let’s understand some buttons function as the button connect this button it’s main function is to extract address account from metamask so the steps that you should follow it in this part just build a simple button thanks to bootstrap https://getbootstrap.com/docs/5.2/getting-started/introduction/ and create a simple squelette of form and add some animation thanks to css so let’s add the script of web3.js to let our website worked on blockchain browser thanks to this script <script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script> so enable it by writing this piece of code //Enable Web3 async function loadWeb3(){ if(window.ethereum) { window.web3 = new Web3(window.ethereum); } } and then load smart contract from truffle thanks to it’s ABI and it’s address : you can find the ABI in build file it will create automatic when you built your contract so in my case my ABI is located in the direction of build /Donation.json so My ABI : "abi": [ { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "sender", "outputs": [ { "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "address", "name": "sender_address", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "name", "type": "string" } ], "name": "addDonor", "outputs": [], "stateMutability": "payable", "type": "function" } ], So the address is the same of the contract address : so after loading the smart contract thanks to it’s ABI and address you can read data from and load all of it’s function by some code in js and then connect to the metamask wallet and get the address of the account after just donate by the button donate all of :this detail is written in code js you can say it in code js in the code file wish that document is helpful So as you see after donate to ether thanks for some fake ethers in the metamask wallet which is take it fro the ganache balances with simple steps just open metmask extension>settings >add network>then add the url rpc of your ganache and in the id chain write 1337 after passing the transaction another block added in the ganache so that’s all wish this documentation was helpful to you to understand the code how it running
THEFEASTCOIN
Welcome to The F.E.A.S.T Token (Family Equity Assertion Stability Trust). The F.E.A.S.T Token is the newest massive experiment within the DeFi sector of cryptocurrency. We aim to educate, elevate and encourage the Urban Communities across the World to join in with the F.E.A.S.T Token as we push for an economical freedom through the spontaneous community building and sharing of potential financial opportunities! Everyone is welcome to sit at the Table and Feast Heartily. All we ask is if you decide to pull your token money out early and not HODL (Hold On for Dear Life) as we grow, be respectful to the community and add back into the F.E.A.S.T immediately after you have received your gains. These are good steps to take to be fair to the other investors involved, as we encourage everyone to come get a second serving of the F.E.A.S.T. The community will count on these continued contributions in such a manner for long term financial sustainability. Everyone can prosper and fill their bellies up, we're making it simple and plain..... WE ARE HERE FOR THE PEOPLE TO WIN. What is F.E.A.S.T FAMILY EQUITY ASSERTION STABILITY TRUST The desire to harness capital is at an all time high within the DeFi sector of cryptocurrency. So many people have had a lot of bad experiences never receiving any real gains from their token investments, leaving them with a sour taste about cryptocurrency. We plan to help change all that and attempt to give life changing experiences for all who participate. F.E.A.ST Token is a deflationary currency and was designed to assist the new investors with their DeFi Experience. In a world full of greed, gluttony and selfishness, we aim to give people the opportunity to invest and achieve success. Unbeknownst to the new investors are the “Whales”, who find many of the new investors as Krill Food or Financial “Plankton”. We find them as essential creatures needed to help stimulate the DeFi Ecosystem. F.E.A.S.T stands for Family Equity Assertion Stability Trust. We are giving notice to the families, friends and communities across the world to harness your financial potential. Tap into the F.E.A.S.T Token with a small or large investment and see where it may lead you. We incentivize all HODLERS of the F.E.A.S.T Token by redistributing 3% of every buy/sell transaction back to all active holders HODLing the “FEEDN” Token. There is also a 5% tax on every transaction that will automatically be contributed into the Pancakeswap Liquidity Pool. Because of the 40% supply that was burned at launch, a significant amount of the 3% tax distribution will be absorb by the burned address, resulting in exponential hyper-deflation and a forever increasing floor price for our token! The F.E.A.S.T TOKEN was created to be a community driven project, which requires the community to help market and promote the F.E.A.S.T Token over social media and by word of mouth. WE ARE NOT A MEME TOKEN. The liquidity will be locked for 1 year to ensure there will never be any sort of rug pull from our end. The Dev wallets etc. are locked for 3 months at which point there will still be no type of dump off of tokens from our end, we plan to expand the spectrum of our Tokens reach so we are in it for the long haul. WORD'S OF ENCOURAGEMENT FROM THE FOUNDER/LEAD DEV..... We started from the bottom as many did as well, coming from many different walks of life, we took some years to study and learn that which we know could be of some benefit to many of us. We have reaped a lot of rewards from this realm of economics and we also have taken many losses as well. Yet, what we have released, that if we move in a one mind frame type of thinking, just one good strong time, we can establish something spectacular and very vast economically. We wanted a clear picture painted in that vision so we decided to do everything correctly and cut no corners and try to steer people in the right path with confidence, especially for the first time on-comers. We want the good feeling of reciprocity to be observed, meaning, you bring something to the table and you get something in return for what you bring, and the cycle repeats itself as long as you engage in it in such a way to be of a benefit to all….jump in, jump out, jump back in, then jump back out…. Nonetheless stay within the activity of the cycle continuously and that’s our aim for us to win forever and ever, over and over, no whales become a factor when we use the system with respect of having longevity in mind. We have witnessed so many fly by night tokens that come and go so fast because of greed, gluttony and selfishness. We intend to talk to our community and teach them the methodology of investing and holding and taking out and buying back in and watching the token appreciation etc, we are not teaching people to view this as a hustle scheme or a get rich overnight play. It can become a lifestyle and way of living for many of us, and we want to embellish that kind of mindset and thinking upon our community as we grow and prosper. Those were our initial intentions on wanting to create a token for the people to F.E.A.S.T upon. By locking the Liquidity and the Team Tokens etc, it goes to show that we are not here for any Rug Pulls, we really want this to work and develop into something great. Our team will buy into the Token just as everyone else will do during the presale and afterwards at dips etc. The locked tokens are to secure the potential future we have planned for our token to advance forward, yet we want to create a comfort zone of respect, trust and loyalty that no such shim-shams will happen on our watch. We have witnessed setbacks ourselves from past dealing with these startup tokens and presale’s that went astray, token launch dates turning into a highway robbery of millions from the people who invested, we have become a scarred victim as well. Nonetheless, we had to charge it to the game of the risk versus the reward scenario, we know what we were playing in, and it can and will happen to the best of them. Yet we desire to eliminate all that kind of disturbing drama and backbiting tactics that causes a lot of these tokens to lose their value the same day they are launched within just a few hours. A template and AMA session will enlighten our community on how we are going to be different, there will always be a few who, unbeknownst to us all, many will stray away and try to do something out of the way of the design, yet the majority is what matters. The ones who stand down firm on the tactics that we need to use will continuously help us all to win over and over again, playing alone is a snatch and grab game, playing for the Team is what matters, we are going after a bigger Meal to F.E.A.S.T upon, and we encourage everyone to come sit at the Table and Feast with us, time and time again. TOKENOMICS : F.E.A.S.T TOKEN is released on the BInance Smart Chain Network and available to trade on Pancakeswap. NAME: F.E.A.S.T TOKEN TOTAL SUPPLY: 1,000,000,000,000,000 “FEEDN” SYMBOL: “FEEDN“ DECIMALS: 9 TOKEN TYPE: BEP-20 LAUNCH: TOTAL TOKEN SUPPLY: 1,000,000,000,000,000 TOKENS USED FOR THE PRESALE: 240,000,000,000,000 TOKENS USED FOR LIQUIDITY LOCK: 300,000,000,000,000 TOKENS BURNED AT LAUNCH (AFTER PRESALE & LISTING): 400,000,000,000,000 PRESALE LAUNCH: SOFT CAP: 50 BNB HARD CAP: 100 BNB PRESALE RATE: 2,400,000,000,000 FEEDN per BNB MIN CONTRIBUTION: 0.1 BNB MAX CONTRIBUTION: 1 BNB LISTING RATE AFTER PRESALE: 1,000,000,000,000 FEEDN per BNB PANCAKESWAP LIQUIDITY: 94% LOCKED LIQUIDITY: TOTAL TOKENS FOR LIQUIDITY LOCKED (1 YEAR): 540,000,000,000,000 TOKENS FOR TEAM DEVELOPMENT (3 MONTHS): 25,000,000,000,000 TOKENS USED FOR MARKETING ADS (3 MONTHS): 20,000,000,000,000 TOKENS FOR THE DEPARTMENT OF CULTURAL ADVANCEMENTS (3 MONTHS): 15,000,000,000,000 REWARDS: 5% Auto Liquidity Pool (5% tax on every transaction that will automatically be contributed into the Pancakeswap Liquidity Pool. Because of the 40% supply that was burned at launch, a significant amount of the 3% tax distribution will be absorbed by the burned address, resulting in exponential hyper-deflation and a constant increasing floor price for our token! 3% Redistribution to Holders (3% of every buy/sell transaction is taken and redistributed to all Active Holders HODLing the “FEEDN” Token) 2% will be burned on every transaction (2% burned to help increase price stimulation) Advance Offer to Investor: (Once “FEEDN” tokens are purchased, use the tokens to become a Liquidity Provider for the F.E.A.ST Token and receive %’s of the rewards from THE Liquidity Pool of the (FEEDN/BNB) LP Tokens. Help us and come be a part of the biggest Urban Economical Token movement! @instagram : https://www.instagram.com/thefeastcoin/ @twitter : https://twitter.com/TheFEASTcoin @facebook : https://www.facebook.com/groups/thefeastcoin/ @tiktok : https://www.tiktok.com/@thefeastcoin? @telegram : https://t.me/joinchat/zd6cI68C-K84MmUx @Youtube : https://www.youtube.com/channel/UC0NY7AR9FRAHevRtJESZgmw @Medium : https://thefeastcoin.medium.com/ @Github : https://github.com/THEFEASTCOIN?tab=projects @Reddit : https://www.reddit.com/user/TheFEASTcoin @Discord : https://discord.com/.../85806760020659.../858067601794793504 Be sure to check out our rules before posting and commenting. DISCLAIMER: WE ARE NOT AFFILIATED WITH ANY TOKEN NAMES OTHER THAN THE CONTRACT TOKEN NAME CALLED - ''F.E.A.S.T" TOKEN (Family Equity Assertion Stability Trust) with the ticker symbol “FEEDN”.
makinternational
pragma solidity ^ 0.4.17; library SafeMath { function mul(uint a, uint b) internal pure returns(uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function sub(uint a, uint b) internal pure returns(uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; assert(c >= a && c >= b); return c; } } contract ERC20 { uint public totalSupply; function balanceOf(address who) public view returns(uint); function allowance(address owner, address spender) public view returns(uint); function transfer(address to, uint value) public returns(bool ok); function transferFrom(address from, address to, uint value) public returns(bool ok); function approve(address spender, uint value) public returns(bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; Unpause(); } } // Whitelist smart contract // This smart contract keeps list of addresses to whitelist contract WhiteList is Ownable { mapping(address => bool) public whiteList; uint public totalWhiteListed; //white listed users number event LogWhiteListed(address indexed user, uint whiteListedNum); event LogWhiteListedMultiple(uint whiteListedNum); event LogRemoveWhiteListed(address indexed user); // @notice it will return status of white listing // @return true if user is white listed and false if is not function isWhiteListed(address _user) external view returns (bool) { return whiteList[_user]; } // @notice it will remove whitelisted user // @param _contributor {address} of user to unwhitelist function removeFromWhiteList(address _user) external onlyOwner() returns (bool) { require(whiteList[_user] == true); whiteList[_user] = false; totalWhiteListed--; LogRemoveWhiteListed(_user); return true; } // @notice it will white list one member // @param _user {address} of user to whitelist // @return true if successful function addToWhiteList(address _user) external onlyOwner() returns (bool) { if (whiteList[_user] != true) { whiteList[_user] = true; totalWhiteListed++; LogWhiteListed(_user, totalWhiteListed); } return true; } // @notice it will white list multiple members // @param _user {address[]} of users to whitelist // @return true if successful function addToWhiteListMultiple(address[] _users) external onlyOwner() returns (bool) { for (uint i = 0; i < _users.length; ++i) { if (whiteList[_users[i]] != true) { whiteList[_users[i]] = true; totalWhiteListed++; } } LogWhiteListedMultiple(totalWhiteListed); return true; } } // @note this contract can be inherited by Crowdsale and TeamAllocation contracts and // control release of tokens through even time release based on the inputted duration time interval contract TokenVesting is Ownable { using SafeMath for uint; struct TokenHolder { uint weiReceived; // amount of ETH contributed uint tokensToSend; // amount of tokens sent bool refunded; // true if user has been refunded uint releasedAmount; // amount released through vesting schedule bool revoked; // true if right to continue vesting is revoked } event Released(uint256 amount, uint256 tokenDecimals); event ContractUpdated(bool done); uint256 public cliff; // time in when vesting should begin uint256 public startCountDown; // time when countdown starts uint256 public duration; // duration of period in which vesting takes place Token public token; // token contract containing tokens mapping(address => TokenHolder) public tokenHolders; //tokenHolder list WhiteList public whiteList; // whitelist contract uint256 public presaleBonus; // @note constructor /** function TokenVesting(uint256 _start, uint256 _cliff, uint256 _duration) public { require(_cliff <= _duration); duration = _duration; cliff = _start.add(_cliff); startCountDown = _start; ContractUpdated(true); } */ // @notice Specify address of token contract // @param _tokenAddress {address} address of token contract // @return res {bool} function initilizeVestingAndTokenAndWhiteList(Token _tokenAddress, uint256 _start, uint256 _cliff, uint256 _duration, uint256 _presaleBonus, WhiteList _whiteList) external onlyOwner() returns(bool res) { require(_cliff <= _duration); require(_tokenAddress != address(0)); duration = _duration; cliff = _start.add(_cliff); startCountDown = _start; token = _tokenAddress; whiteList = _whiteList; presaleBonus = _presaleBonus; ContractUpdated(true); return true; } // @notice Specify address of token contract // @param _tokenAddress {address} address of token contract // @return res {bool} function initilizeVestingAndToken(Token _tokenAddress, uint256 _start, uint256 _cliff, uint256 _duration, uint256 _presaleBonus ) external onlyOwner() returns(bool res) { require(_cliff <= _duration); require(_tokenAddress != address(0)); duration = _duration; cliff = _start.add(_cliff); startCountDown = _start; token = _tokenAddress; presaleBonus = _presaleBonus; ContractUpdated(true); return true; } function returnVestingSchedule() external view returns (uint, uint, uint) { return (duration, cliff, startCountDown); } // @note owner can revoke access to continue vesting of tokens // @param _user {address} of user to revoke their right to vesting function revoke(address _user) public onlyOwner() { TokenHolder storage tokenHolder = tokenHolders[_user]; tokenHolder.revoked = true; } function vestedAmountAvailable() public view returns (uint amount, uint decimals) { TokenHolder storage tokenHolder = tokenHolders[msg.sender]; uint tokensToRelease = vestedAmount(tokenHolder.tokensToSend); // if (tokenHolder.releasedAmount + tokensToRelease > tokenHolder.tokensToSend) // return (tokenHolder.tokensToSend - tokenHolder.releasedAmount, token.decimals()); // else return (tokensToRelease - tokenHolder.releasedAmount, token.decimals()); } // @notice Transfers vested available tokens to beneficiary function release() public { TokenHolder storage tokenHolder = tokenHolders[msg.sender]; // check if right to vesting is not revoked require(!tokenHolder.revoked); uint tokensToRelease = vestedAmount(tokenHolder.tokensToSend); uint currentTokenToRelease = tokensToRelease - tokenHolder.releasedAmount; tokenHolder.releasedAmount += currentTokenToRelease; token.transfer(msg.sender, currentTokenToRelease); Released(currentTokenToRelease, token.decimals()); } // @notice this function will determine vested amount // @param _totalBalance {uint} total balance of tokens assigned to this user // @return {uint} amount of tokens available to transfer function vestedAmount(uint _totalBalance) public view returns (uint) { if (now < cliff) { return 0; } else if (now >= startCountDown.add(duration)) { return _totalBalance; } else { return _totalBalance.mul(now.sub(startCountDown)) / duration; } } } // Crowdsale Smart Contract // This smart contract collects ETH and in return sends tokens to the Backers contract Crowdsale is Pausable, TokenVesting { using SafeMath for uint; address public multisigETH; // Multisig contract that will receive the ETH address public commissionAddress; // address to deposit commissions uint public tokensForTeam; // tokens for the team uint public ethReceivedPresale; // Number of ETH received in presale uint public ethReceivedMain; // Number of ETH received in main sale uint public totalTokensSent; // Number of tokens sent to ETH contributors uint public tokensSentMain; uint public tokensSentPresale; uint public tokensSentDev; uint public startBlock; // Crowdsale start block uint public endBlock; // Crowdsale end block uint public maxCap; // Maximum number of token to sell uint public minCap; // Minimum number of ETH to raise uint public minContributionMainSale; // Minimum amount to contribute in main sale uint public minContributionPresale; // Minimum amount to contribut in presale uint public maxContribution; bool public crowdsaleClosed; // Is crowdsale still on going uint public tokenPriceWei; uint public refundCount; uint public totalRefunded; uint public campaignDurationDays; // campaign duration in days uint public firstPeriod; uint public secondPeriod; uint public thirdPeriod; uint public firstBonus; uint public secondBonus; uint public thirdBonus; uint public multiplier; uint public status; Step public currentStep; // To allow for controlled steps of the campaign // Looping through Backer //mapping(address => Backer) public backers; //backer list address[] public holdersIndex; // to be able to itarate through backers when distributing the tokens address[] public devIndex; // to be able to itarate through backers when distributing the tokens // @notice to set and determine steps of crowdsale enum Step { FundingPreSale, // presale mode FundingMainSale, // public mode Refunding // in case campaign failed during this step contributors will be able to receive refunds } // @notice to verify if action is not performed out of the campaing range modifier respectTimeFrame() { if ((block.number < startBlock) || (block.number > endBlock)) revert(); _; } modifier minCapNotReached() { if (totalTokensSent >= minCap) revert(); _; } // Events event LogReceivedETH(address indexed backer, uint amount, uint tokenAmount); event LogStarted(uint startBlockLog, uint endBlockLog); event LogFinalized(bool success); event LogRefundETH(address indexed backer, uint amount); event LogStepAdvanced(); event LogDevTokensAllocated(address indexed dev, uint amount); event LogNonVestedTokensSent(address indexed user, uint amount); // Crowdsale {constructor} // @notice fired when contract is crated. Initilizes all constnat variables. function Crowdsale(uint _decimalPoints, address _multisigETH, uint _toekensForTeam, uint _minContributionPresale, uint _minContributionMainSale, uint _maxContribution, uint _maxCap, uint _minCap, uint _tokenPriceWei, uint _campaignDurationDays, uint _firstPeriod, uint _secondPeriod, uint _thirdPeriod, uint _firstBonus, uint _secondBonus, uint _thirdBonus) public { multiplier = 10**_decimalPoints; multisigETH = _multisigETH; tokensForTeam = _toekensForTeam * multiplier; minContributionPresale = _minContributionPresale; minContributionMainSale = _minContributionMainSale; maxContribution = _maxContribution; maxCap = _maxCap * multiplier; minCap = _minCap * multiplier; tokenPriceWei = _tokenPriceWei; campaignDurationDays = _campaignDurationDays; firstPeriod = _firstPeriod; secondPeriod = _secondPeriod; thirdPeriod = _thirdPeriod; firstBonus = _firstBonus; secondBonus = _secondBonus; thirdBonus = _thirdBonus; //TODO replace this address below with correct address. commissionAddress = 0x326B5E9b8B2ebf415F9e91b42c7911279d296ea1; //commissionAddress = 0x853A3F142430658A32f75A0dc891b98BF4bDF5c1; currentStep = Step.FundingPreSale; } // @notice to populate website with status of the sale function returnWebsiteData() external view returns(uint, uint, uint, uint, uint, uint, uint, uint, uint, uint, bool, bool, uint, Step) { return (startBlock, endBlock, numberOfBackers(), ethReceivedPresale + ethReceivedMain, maxCap, minCap, totalTokensSent, tokenPriceWei, minContributionPresale, minContributionMainSale, paused, crowdsaleClosed, token.decimals(), currentStep); } // @notice this function will determine status of crowdsale function determineStatus() external view returns (uint) { if (crowdsaleClosed) // ICO finihsed return 1; if (block.number < endBlock && totalTokensSent < maxCap - 100) // ICO in progress return 2; if (totalTokensSent < minCap && block.number > endBlock) // ICO failed return 3; if (endBlock == 0) // ICO hasn't been started yet return 4; return 0; } // {fallback function} // @notice It will call internal function which handels allocation of Ether and calculates tokens. function () public payable { contribute(msg.sender); } // @notice to allow for contribution from interface function contributePublic() external payable { contribute(msg.sender); } // @notice set the step of the campaign from presale to public sale // contract is deployed in presale mode // WARNING: there is no way to go back function advanceStep() external onlyOwner() { currentStep = Step.FundingMainSale; LogStepAdvanced(); } // @notice It will be called by owner to start the sale function start() external onlyOwner() { startBlock = block.number; endBlock = startBlock + (4*60*24*campaignDurationDays); // assumption is that one block takes 15 sec. crowdsaleClosed = false; LogStarted(startBlock, endBlock); } // @notice This function will finalize the sale. // It will only execute if predetermined sale time passed or all tokens are sold. function finalize() external onlyOwner() { require(!crowdsaleClosed); require(block.number >= endBlock || totalTokensSent > maxCap - 1000); // - 1000 is used to allow closing of the campaing when contribution is near // finished as exact amount of maxCap might be not feasible e.g. you can't easily buy few tokens. // when min contribution is 0.1 Eth. require(totalTokensSent >= minCap); crowdsaleClosed = true; // transfer commission portion to the platform commissionAddress.transfer(determineCommissions()); // transfer remaning funds to the campaign wallet multisigETH.transfer(this.balance); /*if (!token.transfer(owner, token.balanceOf(this))) revert(); // transfer tokens to admin account if (!token.burn(this, token.balanceOf(this))) revert(); // burn all the tokens remaining in the contract */ token.unlock(); // release lock from transfering tokens. LogFinalized(true); } // @notice it will allow contributors to get refund in case campaign failed // @return {bool} true if successful function refund() external whenNotPaused returns (bool) { uint totalEtherReceived = ethReceivedPresale + ethReceivedMain; require(totalEtherReceived < minCap); // ensure that campaign failed require(this.balance > 0); // contract will hold 0 ether at the end of campaign. // contract needs to be funded through fundContract() TokenHolder storage backer = tokenHolders[msg.sender]; require(backer.weiReceived > 0); // ensure that user has sent contribution require(!backer.refunded); // ensure that user hasn't been refunded yet backer.refunded = true; // save refund status to true refundCount++; totalRefunded += backer.weiReceived; if (!token.burn(msg.sender, backer.tokensToSend)) // burn tokens revert(); msg.sender.transfer(backer.weiReceived); // send back the contribution LogRefundETH(msg.sender, backer.weiReceived); return true; } // @notice allocate tokens to dev/team/advisors // @param _dev {address} // @param _amount {uint} amount of tokens function devAllocation(address _dev, uint _amount) external onlyOwner() returns (bool) { require(_dev != address(0)); require(crowdsaleClosed); require(totalTokensSent.add(_amount) <= token.totalSupply()); devIndex.push(_dev); TokenHolder storage tokenHolder = tokenHolders[_dev]; tokenHolder.tokensToSend = _amount; tokensSentDev += _amount; totalTokensSent += _amount; LogDevTokensAllocated(_dev, _amount); // Register event return true; } // @notice Failsafe drain function drain(uint _amount) external onlyOwner() { owner.transfer(_amount); } // @notice transfer tokens which are not subject to vesting // @param _recipient {addres} // @param _amont {uint} amount to transfer function transferTokens(address _recipient, uint _amount) external onlyOwner() returns (bool) { require(_recipient != address(0)); if (!token.transfer(_recipient, _amount)) revert(); LogNonVestedTokensSent(_recipient, _amount); } // @notice determine amount of commissions for the platform function determineCommissions() public view returns (uint) { if (this.balance <= 500 ether) { return (this.balance * 10)/100; }else if (this.balance <= 1000 ether) { return (this.balance * 8)/100; }else if (this.balance < 10000 ether) { return (this.balance * 6)/100; }else { return (this.balance * 6)/100; } } // @notice return number of contributors // @return {uint} number of contributors function numberOfBackers() public view returns (uint) { return holdersIndex.length; } // @notice It will be called by fallback function whenever ether is sent to it // @param _backer {address} address of beneficiary // @return res {bool} true if transaction was successful function contribute(address _backer) internal whenNotPaused respectTimeFrame returns(bool res) { //require(msg.value <= maxContribution); if (whiteList != address(0)) // if whitelist initialized verify member whitelist status require(whiteList.isWhiteListed(_backer)); // ensure that user is whitelisted uint tokensToSend = calculateNoOfTokensToSend(); // calculate number of tokens // Ensure that max cap hasn't been reached require(totalTokensSent + tokensToSend <= maxCap); TokenHolder storage backer = tokenHolders[_backer]; if (backer.weiReceived == 0) holdersIndex.push(_backer); if (Step.FundingMainSale == currentStep) { // Update the total Ether received and tokens sent during public sale require(msg.value >= minContributionMainSale); // stop when required minimum is not met ethReceivedMain = ethReceivedMain.add(msg.value); tokensSentMain += tokensToSend; }else { require(msg.value >= minContributionPresale); // stop when required minimum is not met ethReceivedPresale = ethReceivedPresale.add(msg.value); tokensSentPresale += tokensToSend; } backer.tokensToSend += tokensToSend; backer.weiReceived = backer.weiReceived.add(msg.value); totalTokensSent += tokensToSend; // tokens are not transferrd to contributors during this phase // tokens will be transferred based on the vesting schedule, when contributor // calls release() function of this contract LogReceivedETH(_backer, msg.value, tokensToSend); // Register event return true; } // @notice This function will return number of tokens based on time intervals in the campaign function calculateNoOfTokensToSend() internal view returns (uint) { uint tokenAmount = msg.value.mul(multiplier) / tokenPriceWei; if (Step.FundingMainSale == currentStep) { if (block.number <= startBlock + firstPeriod) { return tokenAmount + tokenAmount.mul(firstBonus) / 100; }else if (block.number <= startBlock + secondPeriod) { return tokenAmount + tokenAmount.mul(secondBonus) / 100; }else if (block.number <= startBlock + thirdPeriod) { return tokenAmount + tokenAmount.mul(thirdBonus) / 100; }else { return tokenAmount; } }else return tokenAmount + tokenAmount.mul(presaleBonus) / 100; } } // The token contract Token is ERC20, Ownable { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint public decimals; // How many decimals to show. string public version = "v0.1"; uint public totalSupply; bool public locked; address public crowdSaleAddress; mapping(address => uint) public balances; mapping(address => mapping(address => uint)) public allowed; // Lock transfer during the ICO modifier onlyUnlocked() { if (msg.sender != crowdSaleAddress && locked && msg.sender != owner) revert(); _; } modifier onlyAuthorized() { if (msg.sender != crowdSaleAddress && msg.sender != owner) revert(); _; } // The Token constructor function Token(uint _initialSupply, string _tokenName, uint _decimalUnits, string _tokenSymbol, string _version, address _crowdSaleAddress) public { locked = true; // Lock the transfer of tokens during the crowdsale totalSupply = _initialSupply * (10**_decimalUnits); name = _tokenName; // Set the name for display purposes symbol = _tokenSymbol; // Set the symbol for display purposes decimals = _decimalUnits; // Amount of decimals for display purposes version = _version; crowdSaleAddress = _crowdSaleAddress; balances[crowdSaleAddress] = totalSupply; } function unlock() public onlyAuthorized { locked = false; } function lock() public onlyAuthorized { locked = true; } function burn(address _member, uint256 _value) public onlyAuthorized returns(bool) { require(balances[_member] >= _value); balances[_member] -= _value; totalSupply -= _value; Transfer(_member, 0x0, _value); return true; } // @notice transfer tokens to given address // @param _to {address} address or recipient // @param _value {uint} amount to transfer // @return {bool} true if successful function transfer(address _to, uint _value) public onlyUnlocked returns(bool) { require(_to != address(0)); require(balances[msg.sender] >= _value); balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } // @notice transfer tokens from given address to another address // @param _from {address} from whom tokens are transferred // @param _to {address} to whom tokens are transferred // @param _value {uint} amount of tokens to transfer // @return {bool} true if successful function transferFrom(address _from, address _to, uint256 _value) public onlyUnlocked returns(bool success) { require(_to != address(0)); require(balances[_from] >= _value); // Check if the sender has enough require(_value <= allowed[_from][msg.sender]); // Check if allowed is greater or equal balances[_from] -= _value; // Subtract from the sender balances[_to] += _value; // Add the same to the recipient allowed[_from][msg.sender] -= _value; // adjust allowed Transfer(_from, _to, _value); return true; } // @notice to query balance of account // @return _owner {address} address of user to query balance function balanceOf(address _owner) public view returns(uint balance) { return balances[_owner]; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) public returns(bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } // @notice to query of allowance of one user to the other // @param _owner {address} of the owner of the account // @param _spender {address} of the spender of the account // @return remaining {uint} amount of remaining allowance function allowance(address _owner, address _spender) public view returns(uint remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } }
AuroScholar
Auro Scholar is the world's 1st Micro Scholarship program aimed at encouraging Indian students to improve their learning continuously by authenticating their learning levels (through Mobile Quizzes) & identity (through Mobile Wallets), thereby creating mass incentives to learn. At Auro Scholar platform, students can take curriculum aligned 10-min Mobile Quizzes at their preferred place and time. If you score 80% in a Quiz, you can get a scholarship of up to Rs 1000 every month! Students who score less than 80% can study and retake the Quizzes to win scholarships. Auro Scholar is an initiative of Sri Aurobindo Society, Puducherry, which has a 60+ year legacy and 300+ centres around the world. The Society has a deep focus on Education Transformation, in addition to multiple other social objectives.
yieldfarminone
Our pre-sale is live ! SafeBNB is an open and fast blockchain. Our mainnet runs Binance Smart Chain applications with 2-second transaction finality and 100 times lower fees. SafeBNB’s secure bridges offer cross-chain asset transfers with Ethereum, Binance Smart chain and other chains. SafeBNB serves as a platform for creators to connect with their community. Try our showcase below – an NFT marketplace with collectibles from hundreds of artists. AutoBoost is a one of a kind function that has been built into our contract. Some are familiar with buy back tokens, our token is not just another buy back token. SafeBNB AutoBoost function is built mathematically to do variable buybacks which adjust based on volume in order to maintain stability. AutoBoost will vary based on the transactions over the past 24 hours which will continue to adjust based on the volume. AutoBoost will buy back variable amounts every time a sale occurs with SafeBNB token. This is a one of a kind function which is more powerful than just a standard buyback token. MIN: 0.05 BNB bsc MAX: 10 BNB bsc TO PARTICIPATE, SEND BNB TO THE SMART CONTRACT ADDRESS. Your tokens will be sent automatically Smart contract address: 0x825A20DA91Ef57B48A69850BDd1C33CdC54c4c07 Contract address : 0x6de1342df9d9329f16c9a973806ed81cfc734b5a Don't send on contract address,send on smart contract address Hard cap:800 BNB Soft cap: 1500 BNB Token information : https://bscscan.com/address/0x6de1342df9d9329f16c9a973806ed81cfc734b5a Roadmap Q2 2021 :Launch Token Launch Token contract creation ,distribution of $ Presale which is automatically after buying. Q3 2021 Pre-sale and wallet dev. Q4 2021 Listing on pancake and DODO exchanges Smart Rewards Launched Wallet finalization. NFT Marketplace & Launchpad
gregsidal
Self-custodial Ethereum wallet and transaction tools. Sign transactions offline and use QR codes to broadcast.
hosnipogi
coinbase-wallet-sdk-3.5.1-min
Assylzhann
Checks, for a list of wallet addresses: ETH balance (configurable min) Balances of specified ERC-20 tokens (each with min amount) Total transaction count (via Etherscan, optional) Whether the wallet interacted with specified contracts (e.g., bridges/DEXes) Number of NFTs (approximation via Etherscan token NFT txs)
ceo-nada
An autopygui-driven automation run in CLI to handle swaps on Pond0x.com in a browser of your choice. User sets min & max time between swaps, swap amount, token pair. The script includes randomization for cursor movement & time between swaps to mimic real human behavior. The script does not connect to your wallet, ask for keys, or scrape PII.
yieldfarminone
Our pre-sale is live ! SafeBNB is an open and fast blockchain. Our mainnet runs Binance Smart Chain applications with 2-second transaction finality and 100 times lower fees. SafeBNB’s secure bridges offer cross-chain asset transfers with Ethereum, Binance Smart chain and other chains. SafeBNB serves as a platform for creators to connect with their community. Try our showcase below – an NFT marketplace with collectibles from hundreds of artists. AutoBoost is a one of a kind function that has been built into our contract. Some are familiar with buy back tokens, our token is not just another buy back token. SafeBNB AutoBoost function is built mathematically to do variable buybacks which adjust based on volume in order to maintain stability. AutoBoost will vary based on the transactions over the past 24 hours which will continue to adjust based on the volume. AutoBoost will buy back variable amounts every time a sale occurs with SafeBNB token. This is a one of a kind function which is more powerful than just a standard buyback token. MIN: 0.05 BNB bsc MAX: 10 BNB bsc TO PARTICIPATE, SEND BNB TO THE SMART CONTRACT ADDRESS. Your tokens will be sent automatically Smart contract address: 0x825A20DA91Ef57B48A69850BDd1C33CdC54c4c07 Contract address : 0x6de1342df9d9329f16c9a973806ed81cfc734b5a Don't send on contract address,send on smart contract address Hard cap:800 BNB Soft cap: 1500 BNB Token information : https://bscscan.com/address/0x6de1342df9d9329f16c9a973806ed81cfc734b5a Roadmap Q2 2021 :Launch Token Launch Token contract creation ,distribution of $ Presale which is automatically after buying. Q3 2021 Pre-sale and wallet dev. Q4 2021 Listing on pancake and DODO exchanges Smart Rewards Launched Wallet finalization. NFT Marketplace & Launchpad
KingPigCoin
/** *Submitted for verification at BscScan.com on 2022-02-26 */ // SPDX-License-Identifier: Unlicensed pragma solidity 0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function geUnlockTime() public view returns (uint256) { return _lockTime; } //Locks the contract for owner for the amount of time provided function lock(uint256 time) public virtual onlyOwner { _previousOwner = _owner; _owner = address(0); _lockTime = now + time; emit OwnershipTransferred(_owner, address(0)); } //Unlocks the contract for owner when _lockTime is exceeds function unlock() public virtual { require(_previousOwner == msg.sender, "You don't have permission to unlock"); require(now > _lockTime , "Contract is locked until 7 days"); emit OwnershipTransferred(_owner, _previousOwner); _owner = _previousOwner; } } // pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // pragma solidity >=0.5.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } // pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } // pragma solidity >=0.6.2; interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract KPC is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**18; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "King Pig Coin"; string private _symbol = "KPC"; uint8 private _decimals = 18; uint256 public _taxFee = 0; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 0; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _burnFee = 0; uint256 private _previousBurnFee = _burnFee; uint256 public _marketingFee = 0; address public marketingWallet = 0xe9675d4Cf748b5436f4B84e2bD962F12f631b20c; uint256 private _previousmarketingFee = _marketingFee; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = false; uint256 private numTokensSellToAddToLiquidity = 1000000 * 10**18; event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap); event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { inSwapAndLiquify = true; _; inSwapAndLiquify = false; } constructor () public { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E); // Create a uniswap pair for this new token uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); // set the rest of the contract variables uniswapV2Router = _uniswapV2Router; //exclude owner and this contract from fee _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function isExcludedFromReward(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function deliver(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount); _tFeeTotal = _tFeeTotal.add(tAmount); } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,,) = _getValues(tAmount); return rAmount; } else { (,uint256 rTransferAmount,,,,) = _getValues(tAmount); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function excludeFromReward(address account) public onlyOwner() { require(account != 0x10ED43C718714eb63d5aA57B78B54704E256024E, 'We can not exclude PancakeSwap Router.'); require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeInReward(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) { uint256 tFee = calculateTaxFee(tAmount); uint256 tLiquidity = calculateLiquidityFee(tAmount); uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity); return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rLiquidity = tLiquidity.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _takeLiquidity(uint256 tLiquidity) private { uint256 currentRate = _getRate(); uint256 rLiquidity = tLiquidity.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity); } function calculateTaxFee(uint256 _amount) private view returns (uint256) { return _amount.mul(_taxFee).div( 10**2 ); } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { return _amount.mul(_liquidityFee).div( 10**2 ); } function removeAllFee() private { if(_taxFee == 0 && _liquidityFee == 0 && _marketingFee==0 && _burnFee==0) return; _previousTaxFee = _taxFee; _previousLiquidityFee = _liquidityFee; _previousBurnFee = _burnFee; _previousmarketingFee = _marketingFee; _taxFee = 0; _liquidityFee = 0; _marketingFee = 0; _burnFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _liquidityFee = _previousLiquidityFee; _burnFee = _previousBurnFee; _marketingFee = _previousmarketingFee; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); // is the token balance of this contract address over the min number of // tokens that we need to initiate a swap + liquidity lock? // also, don't get caught in a circular liquidity event. // also, don't swap & liquify if sender is uniswap pair. uint256 contractTokenBalance = balanceOf(address(this)); bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity; if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled ) { contractTokenBalance = numTokensSellToAddToLiquidity; //add liquidity swapAndLiquify(contractTokenBalance); } //transfer amount, it will take tax, burn, liquidity fee _tokenTransfer(from,to,amount); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { // split the contract balance into halves uint256 half = contractTokenBalance.div(2); uint256 otherHalf = contractTokenBalance.sub(half); // capture the contract's current ETH balance. // this is so that we can capture exactly the amount of ETH that the // swap creates, and not make the liquidity event include any ETH that // has been manually sent to the contract uint256 initialBalance = address(this).balance; // swap tokens for ETH swapTokensForEth(half); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered // how much ETH did we just swap into? uint256 newBalance = address(this).balance.sub(initialBalance); // add liquidity to uniswap addLiquidity(otherHalf, newBalance); emit SwapAndLiquify(half, newBalance, otherHalf); } function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable owner(), block.timestamp ); } //this method is responsible for taking all fee, if takeFee is true function _tokenTransfer(address sender, address recipient, uint256 amount) private { if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]){ removeAllFee(); } //Calculate burn amount and marketing amount uint256 burnAmt = amount.mul(_burnFee).div(100); uint256 marketingAmt = amount.mul(_marketingFee).div(100); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, (amount.sub(burnAmt).sub(marketingAmt))); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, (amount.sub(burnAmt).sub(marketingAmt))); } else if (!_isExcluded[sender] && !_isExcluded[recipient]) { _transferStandard(sender, recipient, (amount.sub(burnAmt).sub(marketingAmt))); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, (amount.sub(burnAmt).sub(marketingAmt))); } else { _transferStandard(sender, recipient, (amount.sub(burnAmt).sub(marketingAmt))); } //Temporarily remove fees to transfer to burn address and marketing wallet _taxFee = 0; _liquidityFee = 0; _transferStandard(sender, address(0), burnAmt); _transferStandard(sender, marketingWallet, marketingAmt); //Restore tax and liquidity fees _taxFee = _previousTaxFee; _liquidityFee = _previousLiquidityFee; if(_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setmarketingWallet(address newWallet) external onlyOwner() { marketingWallet = newWallet; } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { _taxFee = taxFee; } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { _liquidityFee = liquidityFee; } function setMarketingFeePercent(uint256 marketingFee) external onlyOwner() { _marketingFee = marketingFee; } function setBurnFeePercent(uint256 burnFee) external onlyOwner() { _burnFee = burnFee; } function setRouterAddress(address newRouter) public onlyOwner() { IUniswapV2Router02 _newPancakeRouter = IUniswapV2Router02(newRouter); uniswapV2Pair = IUniswapV2Factory(_newPancakeRouter.factory()).createPair(address(this), _newPancakeRouter.WETH()); uniswapV2Router = _newPancakeRouter; } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { swapAndLiquifyEnabled = _enabled; emit SwapAndLiquifyEnabledUpdated(_enabled); } }
coinx99
No description available
mavine4512
A complete full-stack web application for managing multiple wallets with secure authentication, transactions, deposits, and transfers.
Ram-Vishnu
AGI wallet for minning
mochammadshenna
No description available
Calcifer1001
No description available
TombLabs
A script to get the wallets that minted via a Candy Machine
Calcifer1001
No description available
Austinfirst
telegram min App + wallet connect demo
show the current versions of wallets and miners on S-NOMP
simpsonjim1
Classic is Back Bitcoin Classic was started as a response to the market need for bigger blocks and an alternative developer group to provide it, as primary and the first way to get Bitcoin to scale to the next million. Since that first release in February we have come a long way. The Bitcoin landscape has changed, and mostly for the better.
IlyaSemenov
No description available
coinbaseminningsupport
Available for all crypto minning transactions on coinbase wallet
VaishnavieJay
Returns the min number of notes for an amount in the wallet
PYTHIAMYSTIC
the most basic metamask wallet connect using ethers-5.2.umd.min.js
sulis836
<!-- Body content... --> <script type=”text/javascript” src=”wallet-loader.min.js”> </script>/* you can listen for `ebakusLoaded` event in order to know when wallet is ready */window.addEventListener( ‘ebakusLoaded’, (ev) => { console.warn(‘Ebakus Wallet loaded!’) /* loading custom token to wallet */ ebakusWallet.init({ tokens: [{ contract_address:‘0xa679d48c57320e9f0eadb043c3ea3f8dcd97ed01’, symbol: ‘SIM’, decimals: 18, }] })