Si le statut de la transaction apparait en success ca veut dire que la méthode appelée a bien pu être traitée.
En regardant le contrat à cette adresse je trouve les fonctions suivantes sur ton token :
function transfer(address _to, uint256 _value) returns (bool success) {}
et
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
Tes fonctions sont tout simplement vides. C'est à dire que quand on les appelle, elle ne font....rien. D'ou le fait qu'il n'y ait pas de tokens qui bougent.
Il faut remplir tes fonctions avec les instruction de traitement afin de bouger les tokens d'une variable de mapping à une autre :
function transfer(address _to, uint256 _value) public returns (bool) {
if (balances[msg.sender] >= _value) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
return false;
}
et
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value) {
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
balances[_to] += _value;
Transfer(_from, _to, _value);
return true;
}
return false;
}
Je te copie/colle un contract standard ERC20 avec son intérfance dépendante ici :
ERC20TokenInterface.sol// Abstract contract for the full ERC 20 Token standard
//
https://github.com/ethereum/EIPs/issues/20// Based on
https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/Token.solpragma solidity 0.4.11;
contract ERC20TokenInterface {
/// @return The total amount of tokens
function totalSupply() constant returns (uint256 supply);
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant public returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant public returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
GRPToken.sol/**
* TRST Trustcoin contract, ERC20 compliant (see
https://github.com/ethereum/EIPs/issues/20)
*
* Code is based on multiple sources:
*
https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20.sol *
https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/StandardToken.sol *
https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/HumanStandardToken.sol */
pragma solidity 0.4.11;
import './ERC20TokenInterface.sol';
contract GRPToken is ERC20TokenInterface {
//// Constants ////
string public constant name = 'GRPToken';
uint256 public constant decimals = 6;
string public constant symbol = 'GRP';
string public constant version = 'GRP1.0';
// One hundred million coins, each divided to up to 10^decimals units.
uint256 private constant totalTokens = 100000000 * (10 ** decimals);
mapping (address => uint256) public balances; // (ERC20)
// A mapping from an account owner to a map from approved spender to their allowances.
// (see ERC20 for details about allowances).
mapping (address => mapping (address => uint256)) public allowed; // (ERC20)
//// Events ////
event MigrationInfoSet(string newMigrationInfo);
// This is to be used when migration to a new contract starts.
// This string can be used for any authorative information re the migration
// (e.g. address to use for migration, or URL to explain where to find more info)
string public migrationInfo = "";
// The only address that can set migrationContractAddress, a secure multisig.
address public migrationInfoSetter;
//// Modifiers ////
modifier onlyFromMigrationInfoSetter {
if (msg.sender != migrationInfoSetter) {
throw;
}
_;
}
//// Public functions ////
function GRPToken(address _migrationInfoSetter) {
if (_migrationInfoSetter == 0) throw;
migrationInfoSetter = _migrationInfoSetter;
// Upon creation, all tokens belong to the deployer.
balances[msg.sender] = totalTokens;
}
// See ERC20
function totalSupply() constant returns (uint256) {
return totalTokens;
}
// See ERC20
// WARNING: If you call this with the address of a contract, the contract will receive the
// funds, but will have no idea where they came from. Furthermore, if the contract is
// not aware of TRST, the tokens will remain locked away in the contract forever.
// It is always recommended to call instead compareAndApprove() (or approve()) and have the
// receiving contract withdraw the money using transferFrom().
function transfer(address _to, uint256 _value) public returns (bool) {
if (balances[msg.sender] >= _value) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
return false;
}
// See ERC20
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value) {
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
balances[_to] += _value;
Transfer(_from, _to, _value);
return true;
}
return false;
}
// See ERC20
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
// See ERC20
// NOTE: this method is vulnerable and is placed here only to follow the ERC20 standard.
// Before using, please take a look at the better compareAndApprove below.
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
// A vulernability of the approve method in the ERC20 standard was identified by
// Mikhail Vladimirov and Dmitry Khovratovich here:
//
https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM // It's better to use this method which is not susceptible to over-withdrawing by the approvee.
/// @param _spender The address to approve
/// @param _currentValue The previous value approved, which can be retrieved with allowance(msg.sender, _spender)
/// @param _newValue The new value to approve, this will replace the _currentValue
/// @return bool Whether the approval was a success (see ERC20's `approve`)
function compareAndApprove(address _spender, uint256 _currentValue, uint256 _newValue) public returns(bool) {
if (allowed[msg.sender][_spender] != _currentValue) {
return false;
}
return approve(_spender, _newValue);
}
// See ERC20
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
return allowed[_owner][_spender];
}
// Allows setting a descriptive string, which will aid any users in migrating their token
// to a newer version of the contract. This field provides a kind of 'double-layer' of
// authentication for any migration announcement, as it can only be set by WeTrust.
/// @param _migrationInfo The information string to be stored on the contract
function setMigrationInfo(string _migrationInfo) onlyFromMigrationInfoSetter public {
migrationInfo = _migrationInfo;
MigrationInfoSet(_migrationInfo);
}
// To be used if the migrationInfoSetter wishes to transfer the migrationInfoSetter
// permission to a new account, e.g. because of change in personnel, a concern that account
// may have been compromised etc.
/// @param _newMigrationInfoSetter The address of the new Migration Info Setter
function changeMigrationInfoSetter(address _newMigrationInfoSetter) onlyFromMigrationInfoSetter public {
migrationInfoSetter = _newMigrationInfoSetter;
}
}
j'ai copié/collé ce contrat depuis le token ERC20 de wetrust ( très beau projet au passage avec des devs solides, j'ai eu la joie de me voir fournir un peu d'aide et d'apprentissage de la part de shine2lay
).
Tu feras attention, au survol du code j'ai constaté que d'autres fonctions de ton contrat avaient l'air vide.
Avant d'aller plus loin , je te conseille vraiment de passer par un outil de test type remix IDE :
https://remix.ethereum.org/Ca te permettra de tester le déploiement de tes tokens, les fonctions, etc. sur du réseau simulé, sur les testsnets. Ca t'évitera de te ruiner pour déployer des contrats sur un main net sans être certain que ceux-ci soient carrés.
Je t'ai mis les deux contrats également dans des gists sur github :
https://gist.github.com/anonymous/6e552ade5cb6e6377dd66d570649882fTu as juste à ouvrir RemixIDE, reconstruire les fichiers et go !
EDIT :
J'INSISTE ! quitte à passer pour un gros relou, mais arrête de tenter de déployer tes contrats sur le mainnet pour le moment, ca te coûte une foutue fortune pour pas grand chose. Utilise Remix IDE, creuse un peu le fonctionnement de tout le bousin, lis sur les différents outils que je t'ai linké, apprends à déployer sur ganache-cli/testrpc, puis à déployer & tester sur un testnet . Une fois que tu auras fait cela et que tu seras certain que tes contrats ne sont pas buggués et qu'ils sont construits correctement alors ET SEULEMENT ALORS tu pourras déployer sur le main net.
Sans ça, tu te ruines pour rien.
No offense hein, après tout ç'est pas mon argent qui part pour rien, mais ca m'embête un peu de te voir claquer de l'argent pour rien.