Skip to main content
replaced http://ethereum.stackexchange.com/ with https://ethereum.stackexchange.com/
Source Link

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(_to.balance<minBalanceForAccounts)
        _to.send((minBalanceForAccounts-_to.balance)/sellPrice);
}
  1. Could It be a valide solution in my casemy case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(_to.balance<minBalanceForAccounts)
        _to.send((minBalanceForAccounts-_to.balance)/sellPrice);
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(_to.balance<minBalanceForAccounts)
        _to.send((minBalanceForAccounts-_to.balance)/sellPrice);
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?
deleted 6 characters in body
Source Link
underdog
  • 1.2k
  • 2
  • 12
  • 24

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(_to.balance<minBalanceForAccounts)
        _to.send(sell((minBalanceForAccounts-_to.balance)/sellPrice));
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(_to.balance<minBalanceForAccounts)
        _to.send(sell((minBalanceForAccounts-_to.balance)/sellPrice));
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(_to.balance<minBalanceForAccounts)
        _to.send((minBalanceForAccounts-_to.balance)/sellPrice);
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?
edited body
Source Link
underdog
  • 1.2k
  • 2
  • 12
  • 24

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(msg.sender_to.balance<minBalanceForAccounts)
        _to.send(sell((minBalanceForAccounts-msg.sender_to.balance)/sellPrice));
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

/* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(msg.sender.balance<minBalanceForAccounts)
        sell((minBalanceForAccounts-msg.sender.balance)/sellPrice);
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?

From CRYPTO-CURRENCY with Ethereum I found this solution in Autorefill section.

In order to do that, first you need to create a variable that will hold the threshold amount and a function to change it. If you don't know any value, set it to 5 finney (0.005 ether).

uint minBalanceForAccounts;

function setMinBalance(uint minimumBalanceInFinney) onlyOwner {
     minBalanceForAccounts = minimumBalanceInFinney * 1 finney;
}

    /* Send coins */
function transfer(address _to, uint256 _value) {
    ...
    if(_to.balance<minBalanceForAccounts)
        _to.send(sell((minBalanceForAccounts-_to.balance)/sellPrice));
}
  1. Could It be a valide solution in my case (new user signin)?
  2. How can I know - before the transaction - the cost of function call (in solidity or in web3)?
Source Link
underdog
  • 1.2k
  • 2
  • 12
  • 24
Loading