Skip to main content

PluginsCore

PluginsCore​

Abstract contract with types and utilities that will be used by many (if not all) Plugins contracts

RouterError​

event RouterError(uint256 routeId, address sender, bytes data)

ConsumableType​

enum ConsumableType {
unaffected,
burned,
NTime
}

TokenType​

enum TokenType {
erc20,
erc721,
erc1155
}

Ingredient​

struct Ingredient {
enum PluginsCore.TokenType token;
enum PluginsCore.ConsumableType consumableType;
address contractAddr;
uint256[] amounts;
uint256[] tokenIds;
}

nUse​

mapping(uint256 => uint256) nUse

usedERC721Inputs​

mapping(address => mapping(uint256 => uint256)) usedERC721Inputs

_useInputs​

function _useInputs(struct PluginsCore.Ingredient[] inputs, address from, address burnAddress, uint256[][] _inputERC721Ids, uint256 amount) internal

will use/consume inputs as dicatated by the configuration

NameTypeDescription
inputsstruct PluginsCore.Ingredient[]set of inputs in the configuration
fromaddressaddress to use/consume inputs from
burnAddressaddressin case configuration requires a burn address to transfer items to
_inputERC721Idsuint256[][]set of ERC721 tokenIds, if applicable Example of _inputERC721Ids with amount = 2 with 3 Ingredients in inputs with TokenType.ERC721 [ [1, 2] [3, 4] [5, 6] ]
amountuint256sets of inputs to use/consume

_validateInputs​

function _validateInputs(struct PluginsCore.Ingredient[] _inputs, struct PluginsCore.Ingredient[] inputs) internal

validates inputs array of ingredients

NameTypeDescription
_inputsstruct PluginsCore.Ingredient[]the inputted array to the Crafter initializer
inputsstruct PluginsCore.Ingredient[]storage array of inputs, copied from _inputs

__gap​

uint256[48] __gap