Payable Functions - Discussion

@thecil Thanks Carlos. I am following your steps in thecil/github. I’ve seen this error msg. some where in chat before.

password: Error 3120007: Already unlocked
Error Details:
Wallet is already unlocked: redruby

cherrybluemoon@Markandrews-MacBook-Pro eosio.token % cleos create account eosio eosio.token EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas

Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations

Ensure that you have the related private keys inside your wallet and your wallet is unlocked.

Error Details:

transaction declares authority '{"actor":"eosio","permission":"active"}', but does not have signatures for it.

Does the mean I need create eosio.code?

The correct way to create an account eosio.token with eosio is as follows:

cleos system newaccount eosio eosio.token EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas --stake-net "1 EOS" --stake-cpu "1 EOS" --buy-ram-kbytes 4

The second error you have is because you don’t have the key for eosio stored in your wallet, add it with:
cleos wallet import
And then paste the private key for eosio into the wallet

The amounts for stake-net and stake-cpu determine how much starting CPU and NET bandwidth will be available.

The amount of RAM you buy will affect the ability to set a contract on the account. 4 KB is the minimum to create an account, and then you need more to set a contract. If you are doing it on a local testnet I would just assign 1000KB for each account that needs RAM to create a smart contract

2 Likes

@Phillip_Hamnett Welcome to the community. I had imported the key into wallet:

cherrybluemoon@Markandrews-MacBook-Pro eosio.token % cleos wallet private_keys -n redruby
Warning: Failed to set locale category LC_NUMERIC to en_NO.
Warning: Failed to set locale category LC_TIME to en_NO.
Warning: Failed to set locale category LC_COLLATE to en_NO.
Warning: Failed to set locale category LC_MONETARY to en_NO.
Warning: Failed to set locale category LC_MESSAGES to en_NO.
password: [[
    "EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas",
    "5JzQxARbUcdLERCZGKVwCgNqJSW38tNPjfdaWSUYYGZDfw1mVFm"
  ]
]

and when I ran
`leos system newaccount eosio eosio.token EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas

I received
ERROR: RequiredError: --stake-net
RROR: RequiredError: --stake-cpu
But resolved with and tried both:

cleos system newaccount --stake-net 1 --stake-cpu 1 creator redruby  eosio eosio.token EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas
ERROR: ExtrasError:

and

cleos system newaccount --stake-net 1 --stake-cpu 1 creator redruby  eosio eosio.token EOS8J867tVruU99vExJWbWGzMVCZN1VDVuJ3xs7SRa7K8E9qRYxas
ERROR: ExtrasError:

I edited my post, please check it again. Sorry I forgot the additional options that were required

2 Likes

@Phillip_Hamnett
It worked after I used the keys from default wallet instead of the wallet I created with different name. Thank you for helping me get through that step.

I final step has got me stump. I was able to create token:
# eosio.token <= eosio.token::create {"issuer":"redruby","maximum_supply":"1000 REDCOIN"}

However I am stuck on trying to issue token:

cleos push action eosio.token issue '["redruby","1000 REDCOIN","Memo"]' -p *eosio@active*

or

cleos push action eosio.token issue '["redruby","1000 REDCOIN","Memo"]' -p *eosio.token@active*

or

cleos push action eosio.token issue '["redruby","1000 REDCOIN","Memo"]' -p ***redruby@active***
Error 3090004: Missing required authority

Ensure that you have the related authority inside your transaction!;

If you are currently using 'cleos push action' command, try to add the relevant authority using -p option.

Error Details:

missing authority of redruby

Don’t use asterix in the permission.
The permission must be eosio.token.
You must issue to eosio.token and then transfer from eosio.token to redruby

1 Like
I’m using @thecil EOSIO CLI commands:

Issue the tokens to an account
cleos push action eosio.token issue '["accountNameHere","XXXXXXNAMECOINHERE","WriteAMemoHere"]' -p <account>@active

Mine is:
cleos push action eosio.token issue ‘[“redruby”,“1000 REDCOIN”,“Memo”]’ -p eosio.token@active

I checked my account which is eosio <= eosio::setcode {"account":"eosio.token"
and issue by:
eosio.token <= eosio.token::create {"issuer":"redruby"

But still receive as mentioned previously `Error 3090004: Missing required authority
Ensure that you have the related authority inside your transaction!;
If you are currently using ‘cleos push action’ command, try to add the relevant authority using -p option.

I have used option -p
I do not understand missing authority when there is -p

Can you show me the issue action from the eosio.token contract that you are using? Perhaps there is a dodgy require_auth in there?

1 Like

@filip
Can I have one account with many contracts? I mean, can I push two different contracts into the same account?