This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.6; | |
library SafeERC20 { | |
using SafeMath for uint256; | |
using Address for address; | |
function safeTransfer(IERC20 token, address to, uint256 value) internal { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stake(uint256 amount) external nonReentrant { | |
require(amount <= maxStakeAmount, 'amount too high'); | |
busd.safeTransferFrom(msg.sender, address(this), amount); | |
if(feePermille > 0) { | |
uint256 feeAmount = amount * feePermille / 1000; | |
busd.safeTransfer(treasury, feeAmount); | |
amount = amount - feeAmount; | |
} | |
uint256 xvonAmount = amount * xvonPermille / 1000; | |
xvon.safeTransferFrom(msg.sender, address(this), xvonAmount); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function redeem(uint256 amount) external nonReentrant { | |
uint256 busdTransferAmount = amount * (1000 - xvonPermille - treasuryPermille) / 1000; | |
uint256 busdTreasuryAmount = amount * treasuryPermille / 1000; | |
uint256 xvonTransferAmount = xvon.balanceOf(address(this)) * amount / vdp.totalSupply(); | |
vdp.burn(msg.sender, amount); | |
busd.safeTransfer(treasury, busdTreasuryAmount); | |
busd.safeTransfer(msg.sender, busdTransferAmount); | |
xvon.safeTransferFrom(msg.sender, address(this), xvonTransferAmount); | |
emit Redeem(msg.sender, amount); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.6; | |
library SafeMath { | |
/** | |
* @dev Returns the addition of two unsigned integers, reverting on | |
* overflow. | |
* | |
* Counterpart to Solidity's `+` operator. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.0; | |
/** | |
* @dev Wrappers over Solidity's arithmetic operations with added overflow | |
* checks. | |
* | |
* Arithmetic operations in Solidity wrap on overflow. This can easily result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*Submitted for verification at BscScan.com on 2020-09-03 | |
*/ | |
/** | |
*Submitted for verification at Bscscan.com on 2020-09-03 | |
*/ | |
pragma solidity ^0.5.16; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HDWalletProvider = require('@truffle/hdwallet-provider'); | |
const infuraKey = ""; | |
const etherApiKey = ""; | |
// | |
const fs = require('fs'); | |
const mnemonic = fs.readFileSync(".secret").toString().trim(); | |
module.exports = { | |
/** | |
* Networks define how you connect to your ethereum client and let you set the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.12; | |
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC20/ERC20.sol"; | |
contract DAI is ERC20 { | |
constructor () public ERC20("Mocked DAI Token", "DAI-T") { | |
_mint(msg.sender, 1000000 * (10 ** uint256(decimals()))); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: contracts/EternalStorage.sol | |
// Initial code from Roman Storm Multi Sender | |
// To Use this Dapp: https://bulktokensending.github.io/bulktokensending | |
pragma solidity ^0.6.6; | |
import 'VonderToken.sol'; | |
/** |