Skip to content
Open

Dev #22

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e49ebdb
Updated full EmiPrice2
Jun 20, 2021
c2a6eb3
Initial version of EmiList
Jun 20, 2021
dcdcbbd
Updated emiList
Jun 20, 2021
6032445
Added getWhiteList, getBlackList
KiselevMaxim Jun 21, 2021
331f4e5
Merge pull request #8 from EMISWAP-COM-INT/feature/blacklist
KiselevMaxim Jun 21, 2021
fcb7e65
Added matic ESW version
KiselevMaxim Jun 25, 2021
122b095
added deployerAdmin
KiselevMaxim Jun 25, 2021
31f8943
ESW-matic with EmiList feature
KiselevMaxim Jun 28, 2021
e748b4a
Merge pull request #9 from EMISWAP-COM-INT/matic
KiselevMaxim Jun 28, 2021
2d066b7
Prepared for kucoin deployment
KiselevMaxim Jul 10, 2021
6d043ef
Updated kucoin contracts
Jul 13, 2021
d133feb
Rename contracts to QC
Jul 13, 2021
81f14d1
EmiPrice EmiVamp full versions, fix EmiVamp.changeFactory
KiselevMaxim Jul 14, 2021
fb35ff3
Added readme for EmiPrice2
erupakov Jul 29, 2021
fb43e3e
Update EmiList.full.sol
erupakov Aug 1, 2021
ac2d833
Update EmiList.full.sol
erupakov Aug 1, 2021
03b345f
Update EmiRouter.Full.sol
erupakov Aug 1, 2021
31aa555
Update ESW.full.sol
erupakov Aug 1, 2021
ad51196
Fixed getting price for low reserve pairs (Emiswap, Uniswap)
KiselevMaxim Sep 28, 2021
46a4b3a
Merge pull request #10 from EMISWAP-COM-INT/feature/kucoin
KiselevMaxim Oct 5, 2021
62e0379
added Polygon vampirism contracts
KiselevMaxim Oct 6, 2021
b6de5c8
Added function transferAnyERC20Token
KiselevMaxim Oct 7, 2021
6153cd3
added Avalanche vampirism contracts
KiselevMaxim Oct 18, 2021
ec3c17e
L2 contract versions and EmiPrice2 flat version
KiselevMaxim Nov 2, 2021
12a4a3c
Added admin function transferAnyERC20Token
KiselevMaxim Nov 29, 2021
13c703d
Added contracts for new chains, modified matic, shiden ESW contracts
KiselevMaxim Feb 27, 2022
b6d7b8c
Added contracts for gatechain
KiselevMaxim Mar 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.EmiPrice2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Pricedump contract README

�������� ������������ ��� ��������� ���������� � ����� ������� �� ������ ���� Uniswap ����� ��������.

## ������ ���������

### getCoinPrices
����� ��������� �� ���� ������ ������� �������, ��� ������� ���������� �������� ���� � ������-��������� �� �����, � ������� ���������� �������� ��� ����.
����� ���������� ������ ��� ��������� ������� �� ��������� � DAI, ���������� �� 100000 (10 � ������� 5) ��� ���������� ������ ����������.
�.�. ��� ��������� ������ ���� � ��������� �� 5 ����� ����� ������� ���������� ���������� �������� �������� � ������� � ��������� ������ � �������� �� 100000.
���� ���� ��� ������-�� ������ ���������� �� �������, � ��������������� ������� ������������ 0.

�������� ��������� _market:
- 0: ���� ����������� �����
- 1: ����� Uniswap
- 2: ����� Mooniswap

```solidity
function getCoinPrices(address [] calldata _coins, uint8 _market) external view returns(uint[] memory prices)
```
185 changes: 185 additions & 0 deletions contracts/ESW-astar.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.2;

import "@openzeppelin/contracts/proxy/Initializable.sol";
import "./libraries/Priviledgeable.sol";
import "./libraries/ProxiedERC20.sol";
import "./libraries/OracleSign.sol";

contract ESW is ProxiedERC20, Initializable, Priviledgeable, OracleSign {
uint256 internal _initialSupply;
mapping(address => uint256) internal _mintLimit;

// !!!In updates to contracts set new variables strictly below this line!!!
//-----------------------------------------------------------------------------------

string public codeVersion = "ESW-astar v1.0-244-g12a4a3c";

uint256 public constant MAXIMUM_SUPPLY = 200_000_000e18;

address public constant oracleMinter =
0xdeb5A983AdC9b25b8A96ae43a65953Ded3939de6; // set to Oracle

mapping(address => uint256) public walletNonce;

address private _emiList;

address public bridgeWallet;

modifier onlyBridge() {
require(msg.sender == bridgeWallet, "Bridge wallet needed");
_;
}

function initialize(address deployerAdmin) public virtual initializer {
_initialize("EmiDAO Token", "ESW", 18);
_addAdmin(deployerAdmin);
_mint(deployerAdmin, 30_000_000e18);
}

/*********************** admin functions *****************************/

function adminMint(address wallet, uint256 amount)
public
onlyAdmin
{
require(
totalSupply().add(amount) <= MAXIMUM_SUPPLY,
"ESW:supply_exceeded"
);
_mint(wallet, amount);
}

function updateTokenName(string memory newName, string memory newSymbol)
public
onlyAdmin
{
_updateTokenName(newName, newSymbol);
}

/**
* set mint limit for exact contract wallets
* @param account - wallet to set mint limit
* @param amount - mint limit value
*/

function setMintLimit(address account, uint256 amount) public onlyAdmin {
_mintLimit[account] = amount;
}

function setBridgeWallet(address newBridgeWallet) public onlyAdmin {
require(newBridgeWallet != address(0), "Bridge address needed!");
bridgeWallet = newBridgeWallet;
}

/*********************** bridge functions *****************************/

function mint(address to, uint256 amount) external onlyBridge returns (bool)
{
_mint(to, amount);
return true;
}

function burn(address from, uint256 amount) external onlyBridge returns (bool)
{
require(from != address(0), "AnyswapV3ERC20: address(0x0)");
_burn(from, amount);
return true;
}

/*********************** public functions *****************************/

function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
super.transfer(recipient, amount);
return true;
}

function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
super.transferFrom(sender, recipient, amount);
return true;
}

function burn(uint256 amount) public {
super._burn(msg.sender, amount);
}

/**
* mintSigned - oracle signed function allow user to mint ESW tokens
* @param recipient - user's wallet for receiving tokens
* @param amount - amount to mint
* @param nonce - user's mint request number, for security purpose
* @param sig - oracle signature, oracle allowance for user to mint tokens
*/

function mintSigned(
address recipient,
uint256 amount,
uint256 nonce,
bytes memory sig
) public {
require(recipient == msg.sender, "ESW:sender");
// check sign
bytes32 message =
_prefixed(
keccak256(abi.encodePacked(recipient, amount, nonce, this))
);

require(
_recoverSigner(message, sig) == oracleMinter &&
walletNonce[msg.sender] < nonce,
"ESW:sign"
);

walletNonce[msg.sender] = nonce;

_mintAllowed(oracleMinter, recipient, amount);
}

/*********************** view functions *****************************/

function initialSupply() public view returns (uint256) {
return _initialSupply;
}

function balanceOf(address account) public view override returns (uint256) {
return super.balanceOf(account);
}

/**
* getMintLimit - read mint limit for wallets
* @param account - wallet address
* @return - mintlimit for requested wallet
*/

function getMintLimit(address account) public view returns (uint256) {
return _mintLimit[account];
}

function getWalletNonce() public view returns (uint256) {
return walletNonce[msg.sender];
}

/*********************** internal functions *****************************/

function _mintAllowed(
address allowedMinter,
address recipient,
uint256 amount
) internal {
require(
totalSupply().add(amount) <= MAXIMUM_SUPPLY,
"ESW:supply_exceeded"
);
_mintLimit[allowedMinter] = _mintLimit[allowedMinter].sub(amount);
super._mint(recipient, amount);
}
}
185 changes: 185 additions & 0 deletions contracts/ESW-aurora.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.2;

import "@openzeppelin/contracts/proxy/Initializable.sol";
import "./libraries/Priviledgeable.sol";
import "./libraries/ProxiedERC20.sol";
import "./libraries/OracleSign.sol";

contract ESW is ProxiedERC20, Initializable, Priviledgeable, OracleSign {
uint256 internal _initialSupply;
mapping(address => uint256) internal _mintLimit;

// !!!In updates to contracts set new variables strictly below this line!!!
//-----------------------------------------------------------------------------------

string public codeVersion = "ESW-aurora v1.0-244-g12a4a3c";

uint256 public constant MAXIMUM_SUPPLY = 200_000_000e18;

address public constant oracleMinter =
0xdeb5A983AdC9b25b8A96ae43a65953Ded3939de6; // set to Oracle

mapping(address => uint256) public walletNonce;

address private _emiList;

address public bridgeWallet;

modifier onlyBridge() {
require(msg.sender == bridgeWallet, "Bridge wallet needed");
_;
}

function initialize(address deployerAdmin) public virtual initializer {
_initialize("EmiDAO Token", "ESW", 18);
_addAdmin(deployerAdmin);
_mint(deployerAdmin, 30_000_000e18);
}

/*********************** admin functions *****************************/

function adminMint(address wallet, uint256 amount)
public
onlyAdmin
{
require(
totalSupply().add(amount) <= MAXIMUM_SUPPLY,
"ESW:supply_exceeded"
);
_mint(wallet, amount);
}

function updateTokenName(string memory newName, string memory newSymbol)
public
onlyAdmin
{
_updateTokenName(newName, newSymbol);
}

/**
* set mint limit for exact contract wallets
* @param account - wallet to set mint limit
* @param amount - mint limit value
*/

function setMintLimit(address account, uint256 amount) public onlyAdmin {
_mintLimit[account] = amount;
}

function setBridgeWallet(address newBridgeWallet) public onlyAdmin {
require(newBridgeWallet != address(0), "Bridge address needed!");
bridgeWallet = newBridgeWallet;
}

/*********************** bridge functions *****************************/

function mint(address to, uint256 amount) external onlyBridge returns (bool)
{
_mint(to, amount);
return true;
}

function burn(address from, uint256 amount) external onlyBridge returns (bool)
{
require(from != address(0), "AnyswapV3ERC20: address(0x0)");
_burn(from, amount);
return true;
}

/*********************** public functions *****************************/

function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
super.transfer(recipient, amount);
return true;
}

function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
super.transferFrom(sender, recipient, amount);
return true;
}

function burn(uint256 amount) public {
super._burn(msg.sender, amount);
}

/**
* mintSigned - oracle signed function allow user to mint ESW tokens
* @param recipient - user's wallet for receiving tokens
* @param amount - amount to mint
* @param nonce - user's mint request number, for security purpose
* @param sig - oracle signature, oracle allowance for user to mint tokens
*/

function mintSigned(
address recipient,
uint256 amount,
uint256 nonce,
bytes memory sig
) public {
require(recipient == msg.sender, "ESW:sender");
// check sign
bytes32 message =
_prefixed(
keccak256(abi.encodePacked(recipient, amount, nonce, this))
);

require(
_recoverSigner(message, sig) == oracleMinter &&
walletNonce[msg.sender] < nonce,
"ESW:sign"
);

walletNonce[msg.sender] = nonce;

_mintAllowed(oracleMinter, recipient, amount);
}

/*********************** view functions *****************************/

function initialSupply() public view returns (uint256) {
return _initialSupply;
}

function balanceOf(address account) public view override returns (uint256) {
return super.balanceOf(account);
}

/**
* getMintLimit - read mint limit for wallets
* @param account - wallet address
* @return - mintlimit for requested wallet
*/

function getMintLimit(address account) public view returns (uint256) {
return _mintLimit[account];
}

function getWalletNonce() public view returns (uint256) {
return walletNonce[msg.sender];
}

/*********************** internal functions *****************************/

function _mintAllowed(
address allowedMinter,
address recipient,
uint256 amount
) internal {
require(
totalSupply().add(amount) <= MAXIMUM_SUPPLY,
"ESW:supply_exceeded"
);
_mintLimit[allowedMinter] = _mintLimit[allowedMinter].sub(amount);
super._mint(recipient, amount);
}
}
Loading