Author

Topic: Empty (Read 162 times)

newbie
Activity: 9
Merit: 0
May 10, 2018, 06:53:01 AM
#7

Ok, I understand it, that is without the permission of the owner of each token I will never be able to destroy them, right?
As far as I have read about basics of solidity, You won't be able to destroy


My doubt was whether the creator of the contract could burn tokens of any account but, according to what you told me the creator always have to be authorized to do that like any other address.

This authorization must be approved through the aproval () function afterwards it is possible to execute burnFrom () or transferFrom () is that correct?

Code:
function approve(address _spender, uint256 _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

Yes you may probably be right . Or I might be wrong with this explanation now...
If you are the creator of tokens and the smart contract, you have full authorization to use the approve() function. Unless you are a individual it's a big NO.

approve() function allows the spender of tokens or another smart contract  to just ask for a withdrawal from a account any number of times, until the tokens balances are exhausted. Here address_spender is the address of the contract. If the return statement is TRUE, then it will invoke receiveapproval() function.

Here is an example which I have quoted from ethwiki for your reference on how does a smart contract work!

https://theethereum.wiki/w/index.php/ERC20_Token_Standard#How_Does_A_Token_Contract_Work.3F

Just check the link, it might be very helpful to you and may solve your doubts to an extent...

My goal is to create a token and distribute it and after burn them. I suppose that each token holder should send me their tokens this way I can burn those tokens. I want to do it in this way to understand how smart contract works.

Why are you trying this in real time? You may use github to practice and learn here : https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.11+commit.68ef5810.js

Quote
The simplest thing would be to send all of them to 0x0 address as you tell me.
No, it would just be invaluable and you cannot use those tokens anytime in future. If you really want to burn and destroy them, then I have answered you above about it.


Yes I've been test all of this under test network on Remix. I will continue doing tests to understand everything definitly. Thanks a lot for your help It was ver useful  Wink
newbie
Activity: 9
Merit: 0
May 08, 2018, 04:46:24 PM
#5
What's your main goal?
Do you need to completely destroy all the tokens present in all addresses and make your total token value to zero? If yes then you need to get the permission of the owner of the tokens and you need to change the value of tokens present in the wallet and you need to subtract the value you burned from the wallet.

For changing the value present in wallet you can use the following code

Code:
function demint(address owner, uint amount) {
    balances[owner] -= amount;
    totalSupply -= amount;
}

If you are the owner of tokens, move them to null address or simply called a zero address 0x0000000000000000000000000000000000000000 as the tokens cannot be used neither by you nor by anyone.

Yes you can execute the burn() function if you are the owner of the contract provided you have the address list, but it's too cumbersome to carry out this task.

Hope this helps.


Ok, I understand it, that is without the permission of the owner of each token I will never be able to destroy them, right?

My doubt was whether the creator of the contract could burn tokens of any account but, according to what you told me the creator always have to be authorized to do that like any other address.

This authorization must be approved through the aproval () function afterwards it is possible to execute burnFrom () or transferFrom () is that correct?

Code:
function approve(address _spender, uint256 _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }


My goal is to create a token and distribute it and after burn them. I suppose that each token holder should send me their tokens this way I can burn those tokens. I want to do it in this way to understand how smart contract works. The simplest thing would be to send all of them to 0x0 address as you tell me.

Thanks!!
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
May 09, 2018, 10:58:49 AM
#4

Ok, I understand it, that is without the permission of the owner of each token I will never be able to destroy them, right?
As far as I have read about basics of solidity, You won't be able to destroy


My doubt was whether the creator of the contract could burn tokens of any account but, according to what you told me the creator always have to be authorized to do that like any other address.

This authorization must be approved through the aproval () function afterwards it is possible to execute burnFrom () or transferFrom () is that correct?

Code:
function approve(address _spender, uint256 _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

Yes you may probably be right . Or I might be wrong with this explanation now...
If you are the creator of tokens and the smart contract, you have full authorization to use the approve() function. Unless you are a individual it's a big NO.

approve() function allows the spender of tokens or another smart contract  to just ask for a withdrawal from a account any number of times, until the tokens balances are exhausted. Here address_spender is the address of the contract. If the return statement is TRUE, then it will invoke receiveapproval() function.

Here is an example which I have quoted from ethwiki for your reference on how does a smart contract work!

https://theethereum.wiki/w/index.php/ERC20_Token_Standard#How_Does_A_Token_Contract_Work.3F

Just check the link, it might be very helpful to you and may solve your doubts to an extent...

My goal is to create a token and distribute it and after burn them. I suppose that each token holder should send me their tokens this way I can burn those tokens. I want to do it in this way to understand how smart contract works.

Why are you trying this in real time? You may use github to practice and learn here : https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.11+commit.68ef5810.js

Quote
The simplest thing would be to send all of them to 0x0 address as you tell me.
No, it would just be invaluable and you cannot use those tokens anytime in future. If you really want to burn and destroy them, then I have answered you above about it.
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
May 08, 2018, 07:57:07 AM
#3
What's your main goal?
Do you need to completely destroy all the tokens present in all addresses and make your total token value to zero? If yes then you need to get the permission of the owner of the tokens and you need to change the value of tokens present in the wallet and you need to subtract the value you burned from the wallet.

For changing the value present in wallet you can use the following code

Code:
function demint(address owner, uint amount) {
    balances[owner] -= amount;
    totalSupply -= amount;
}

If you are the owner of tokens, move them to null address or simply called a zero address 0x0000000000000000000000000000000000000000 as the tokens cannot be used neither by you nor by anyone.

Yes you can execute the burn() function if you are the owner of the contract provided you have the address list, but it's too cumbersome to carry out this task.

Hope this helps.
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
May 08, 2018, 04:28:26 AM
#2
A burn() function is basically used to burn some unsold tokens after the ICO sale in a smart contract. Burn() can be used only when the tokens are present in the smart contract wallet. If you need to destroy all the tokens of even the tokens holders, then it would be impossible or you need to keep an index of all the addresses having your tokens. If you have the list of addresses holding your tokens, then you can perform this task.

If you need to burn the tokens in a contract, try using burn(address _from, uint _value) and burnFrom(address _from, uint _value) 
newbie
Activity: 9
Merit: 0
May 07, 2018, 12:11:24 PM
#1
Empty
Jump to: