9
votes
Accepted
in the system contract, what is required for require_auth(_self)
The _self auth, shown here
require_auth( _self );
requires the authority of the owner of the contract, in this case eosio. If we inspect that account with get account we see this
owner 1: ...
5
votes
Accepted
Require at least one auth from a set of auths
eosio_assert(
has_auth(accounta) || has_auth(accountb),
"missing required authority of accounta or accountb");
See: https://eosio.github.io/eosio.cdt/1.5.0/group__action.html#function-hasauth
4
votes
in the system contract, what is required for require_auth(_self)
The require_auth() directive asserts that the transaction has been signed by the specified account. In the case of require_auth(_self), the assertion is that the transaction has been signed by the ...
3
votes
require_auth for custom role
You can use the require_auth2() function, which can check a custom permission
Verifies that name exists in the set of provided auths on a action.
Throws if not found
Parameters
name -...
3
votes
Accepted
Conditional behavior based upon auth
An example: has_auth(accountname)
See: https://eosio.github.io/eosio.cdt/1.5.0/group__action.html#function-hasauth
2
votes
require_auth differs from the auth check of INLINE_ACTION_SENDER but how?
From an answer by Todd Fleming on the EOS Developers Telegram channel:
If user A authorizes an action sent to contract B then that does not imply B can send an action to contract C with A's ...
2
votes
Accepted
Trying to re-deploy the contract gives Assert Exception (10)
The answer is simple.
Deploy the Hello example with the contract name gazaomauaaae.
Deploy your original contract, again as gazaomauaaae.
DONE.
2
votes
How to tell if a transaction was initiated by account or contract code
If an action is initiated by user account, it will be included in the trx.trx.actions array of a transaction. Follow this idea, we could do:
We have a output actions list from your cleos get actions &...
2
votes
Accepted
use of require_auth2
C++ API is wrapped differently.
inline void require_auth( const permission_level& level ) {
internal_use_do_not_use::require_auth2( level.actor.value, level.permission.value );
}
// how to use
...
1
vote
Accepted
Getting authorization to burn atomicassets via smart contract - WAX
As mentioned in the comments above it is currently not possible to burn those NFTs without changing the owner.
Therefore a transfer is needed.
1
vote
Difference between _self and get_Authorization and RAM optimization
Separate your question into multiple posts next time. Q&A in stackoverflow become a knowledge base for those who experience similar issue, but this kind of question is difficult to be referred by ...
1
vote
Accepted
How to check authorization for a particular account in EOS smart contract?
You can search for an iterator with given key from multi_index first.
iterator found: already created item, require_auth(user)
iterator not found: not created item, require_auth(admin)
Permission ...
1
vote
Require authorization with conditions require_auth(name1 OR name2)
I believe this is what you're looking for:
check(has_auth(name1) || has_auth(name2));
1
vote
Require authorization with conditions require_auth(name1 OR name2)
The above case works if you do it like the following:
void multiauth(name user) {
if (user == name("walletxxxxxx") || user == name("walletzzzzzz"))
{
require_auth(user);
}
else
{
...
1
vote
How do permissions on deferred transactions work?
I would refer to this: https://github.com/EOSIO/eos/issues/3013
It looks like Dawn 4.0 changed the permissions a contract needs to call another contract. You need to grant [email protected] ...
1
vote
Accepted
How does one prevent smart contracts from taking all your tokens, when you give them your auth?
When a contract sends an inline action, it cannot send with the permission level passed by the caller; it sends with a special eosio.code permission name.
In your example, makepokemon can only use ...
1
vote
How does one prevent smart contracts from taking all your tokens, when you give them your auth?
So the user pushes the action with -p user@active, and now the
contract can "steal" those tokens unrightfully? Or am I missing
something?
No, that can not steal the tokens because you check the ...
1
vote
How to link permission to action?
I think, you have an incorrect idea regarding permissions in eos. A
permission in itself does not have any authority to do anything, but
an account with a certain permission can be used to ...
1
vote
Custom permission error 309004/309005
For every transaction, we need to have at least one signer to bill the net and cpu.
And unless we link the action with alice@active permission, the minimum required authority is active.
Try the ...
1
vote
Trying to re-deploy the contract gives Assert Exception (10)
There is a built-in check when deploying a contract to refuse to deploy the contract if it hasn't changed. This can be problematic when you are making changes to the ABI as changes to it don't count ...
1
vote
Cleos asks for authority in transaction, but authority is in transaction
Change it as follows.
cleos -u http://api.eosnewyork.io push action gywaofjugage issue '["issuer", "1.0000 TOKEN", "memo"]' -p issuer
I will arrange what you have done step by step.
In the first ...
1
vote
Accepted
Cleos asks for authority in transaction, but authority is in transaction
In command
cleos -u http://api.eosnewyork.io push action gywaofjugage create '[ "issuer", "1000000000.0000 TOKEN", 0, 0, 0]' -p gywaofjugage
Can you confirm that "issuer" was actually "gywaofjugage" ...
1
vote
Cleos asks for authority in transaction, but authority is in transaction
You seem to be using -p gywaofjugage as the -p option. Try using -p gywaofjugage@active instead?
The -p option is described as "An account and permission level to authorize, as in 'account@permission'...
1
vote
How to do multi authorization?
This article have a very detailed explanation regarding multisig usage on EOS.
https://steemit.com/eos/@genereos/eos-multisig-tutorial
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
authorization × 23smart-contract × 11
permissions × 6
cleos × 2
transactions × 2
accounts × 2
action × 2
javascript × 2
deferred-transactions × 2
eosio-code × 1
ram × 1
tokens × 1
eosio.cdt × 1
dapp × 1
transfer × 1
scatter × 1
inline-action × 1
signing × 1
multisig × 1
library × 1
dapp-development × 1