Skip to content

Commit

Permalink
Merge pull request #1388 from KyberNetwork/incease-gas-limit
Browse files Browse the repository at this point in the history
Increase Gas Limit for adaptation with Istanbul Upgrade
  • Loading branch information
andrewsource147 authored Dec 4, 2019
2 parents d1dfb63 + 99e31a4 commit 6ac1b3e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
6 changes: 6 additions & 0 deletions src/assets/css/market.scss
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,15 @@
}
}
}

@media only screen and (max-width: 1023px) {
padding: 0 0 0 0;
}

@include screen-max-width(medium) {
padding-bottom: 15px;
margin: 0;
}
}

.show-more {
Expand Down
2 changes: 1 addition & 1 deletion src/js/containers/Market/Market.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default class Market extends React.Component {
<a className="x" onClick={this.closeModal}>
<img src={require("../../../assets/img/v3/Close-3.svg")} />
</a>
<div className="market-table">
<div className="market-table theme__background">
<MarketTable
currency={this.props.currency}
listTokens={this.props.listTokens}
Expand Down
14 changes: 8 additions & 6 deletions src/js/containers/Transfer/TransferModals/ConfirmModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ export default class ConfirmModal extends React.Component {
}

getMaxGasTransfer = () => {
const transfer = this.props.transfer
if (transfer.tokenSymbol !== 'DGX') {
return transfer.gas_limit
} else {
return 250000
const transfer = this.props.transfer;
const specialGasLimit = constants.SPECIAL_TRANSFER_GAS_LIMIT[transfer.tokenSymbol];

if (!specialGasLimit) {
return transfer.gas_limit;
}
}

return specialGasLimit;
};

getFormParams = () => {
var tokenSymbol = this.props.transfer.tokenSymbol
Expand Down
28 changes: 9 additions & 19 deletions src/js/sagas/transferActions.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
import { take, put, call, fork, select, takeEvery, all } from 'redux-saga/effects'
import { put, call, takeEvery } from 'redux-saga/effects'
import * as actions from '../actions/transferActions'
import * as utilActions from '../actions/utilActions'
import constants from "../services/constants"
import * as converter from "../utils/converter"
import * as ethUtil from 'ethereumjs-util'

import * as common from "./common"
import * as validators from "../utils/validators"
import * as analytics from "../utils/analytics"

import Tx from "../services/tx"
import { updateAccount, incManualNonceAccount } from '../actions/accountActions'
import { store } from "../store"
import { getTranslate } from 'react-localize-redux';


function* getMaxGasTransfer() {
var state = store.getState()
const transfer = state.transfer
if (transfer.tokenSymbol !== 'DGX') {
return transfer.gas_limit
} else {
return 250000
const state = store.getState();
const transfer = state.transfer;
const specialGasLimit = constants.SPECIAL_TRANSFER_GAS_LIMIT[transfer.tokenSymbol];

if (!specialGasLimit) {
return transfer.gas_limit;
}

return specialGasLimit;
}

function* estimateGasUsed(action) {
Expand All @@ -43,8 +37,6 @@ function* estimateGasUsed(action) {
yield call(fetchAndSetGas, ethereum, fromAddr, transfer.tokenSymbol, transfer.token, decimals, transfer.amount)
}



function* estimateGasUsedWhenSelectToken(action) {
const { symbol, address } = action.payload

Expand Down Expand Up @@ -242,12 +234,10 @@ export function* doAfterAccountImported(action){
}

export function* watchTransfer() {

yield takeEvery("TRANSFER.ESTIMATE_GAS_USED", estimateGasUsed)
yield takeEvery("TRANSFER.SELECT_TOKEN", estimateGasUsedWhenSelectToken)
yield takeEvery("TRANSFER.ESTIMATE_GAS_WHEN_AMOUNT_CHANGE", estimateGasUsedWhenChangeAmount)
yield takeEvery("TRANSFER.FETCH_GAS_SNAPSHOT", fetchGasSnapshot)
yield takeEvery("TRANSFER.VERIFY_TRANSFER", verifyTransfer)

yield takeEvery("ACCOUNT.IMPORT_NEW_ACCOUNT_FULFILLED", doAfterAccountImported)
}
19 changes: 11 additions & 8 deletions src/js/services/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ const INIT_EXCHANGE_FORM_STATE = {
blockNo: 0,
percentChange: 0,
throwOnFailure: "0x0000000000000000000000000000000000000000",
gas: 400000,
max_gas: 400000,
gas: 520000,
max_gas: 520000,
gas_approve: 0,
max_gas_approve: 120000,
max_gas_approve: 160000,
isFetchingGas: false,
gasPrice: 20,
selectedGas: 'f',
Expand Down Expand Up @@ -140,7 +140,7 @@ const INIT_TRANSFER_FORM_STATE = {
destEthName: "",
throwOnFailure: "0x0000000000000000000000000000000000000000",
gas: 21000,
gas_limit: 150000,
gas_limit: 200000,
isFetchingGas: false,
gasPrice: 20,
selectedGas: 'f',
Expand Down Expand Up @@ -258,10 +258,10 @@ const INIT_LIMIT_ORDER_STATE = {
activeOrderTab: "open",
relatedOrders: [],
throwOnFailure: "0x0000000000000000000000000000000000000000",
gas: 380000,
max_gas: 380000,
gas: 500000,
max_gas: 500000,
gas_approve: 0,
max_gas_approve: 120000,
max_gas_approve: 160000,
isFetchingGas: false,
gasPrice: 20,
selectedGas: 'f',
Expand Down Expand Up @@ -376,12 +376,15 @@ const PERM_HINT = "PERM"
const CONNECTION_TIMEOUT = 6000
const TX_CONFIRMING_TIMEOUT = 20000;
const GENESIS_ADDRESS = '0x0000000000000000000000000000000000000000';
const SPECIAL_TRANSFER_GAS_LIMIT = {
'DGX': 330000
};

module.exports = {
ERC20, KYBER_NETWORK, KYBER_WRAPPER, ETHER_ADDRESS, ETH, RESERVES, WETH_SUBSTITUTE_NAME,
INIT_EXCHANGE_FORM_STATE, INIT_TRANSFER_FORM_STATE, ASSET_URL,
IDLE_TIME_OUT, HISTORY_EXCHANGE, STORAGE_KEY, CONNECTION_CHECKER,
CONFIG_ENV_LEDGER_LINK, LEDGER_SUPPORT_LINK, TRANSFER_TOPIC, BASE_HOST, LIST_PARAMS_SUPPORTED,
TRADE_TOPIC, PERM_HINT, CONNECTION_TIMEOUT, INIT_LIMIT_ORDER_STATE, LIMIT_ORDER_CONFIG, SIGN_OFF_WALLETS, KYBER_SWAP_ABI,
EXCHANGE_CONFIG, TRANSFER_CONFIG, LIMIT_ORDER_TOPIC, TX_CONFIRMING_TIMEOUT, GENESIS_ADDRESS
EXCHANGE_CONFIG, TRANSFER_CONFIG, LIMIT_ORDER_TOPIC, TX_CONFIRMING_TIMEOUT, GENESIS_ADDRESS, SPECIAL_TRANSFER_GAS_LIMIT
}

0 comments on commit 6ac1b3e

Please sign in to comment.