Skip to content

allowpred - setup a predicate ​

Allows a specific predicate which will select specific actions of 3rd party accounts to be paid by the account.

FieldTypeDescription
payereosio::nameThe account that setups a predicate
paid_contracteosio::nameThe contract that account will allow paying for
paid_actioneosio::nameThe action from the contract that account will allow paying for
maximum_power_usageuint64_tThe limit for CPU usage in us for paid action
predicate_contractstd::optional<eosio::name>The predicate contract that will be used to create inline action call
predicate_actionstd::optional<eosio::name>The predicate action that will be used to create inline action call

CLI - cleos ​

sh
cleos push action eosio allowpred '["alice", "eosio", "buyram", 2000, "bob", "buyrampred"]' -p alice

JavaScript - eosjs ​

js
await api.transact({
    actions: [
        {
            account: 'eosio',
            name: 'allowpred',
            authorization: [{ actor: 'alice', permission: 'active' }],
            data: {
                payer: 'alice',
                paid_contract: 'eosio',
                paid_action: 'buyram',
                maximum_power_usage: 2000,
                predicate_contract: 'bob',
                predicate_action: 'buyrampred',
            },
        },
    ],
});