/** @title Bank contract
Is the contract handler
function constructor(
address PawnAddress,
address BoardAddress,
address PropAddress,
address MonoAddress,
address LinkAddress,
address StakingAddress
) public
Constructor
ADMIN_ROLE, BANKER_ROLE are given to deployer
- all parameters addresses must not be address(0)*/
Name |
Type |
Description |
PawnAddress |
address |
address |
BoardAddress |
address |
address |
PropAddress |
address |
address |
MonoAddress |
address |
address |
LinkAddress |
address |
address |
StakingAddress |
address |
address |
function buyPawn(
) external
buy a pawn (mandatory to play)
function locatePlayer(
uint16 _edition
) public returns (struct BoardContract.PawnInfo p_)
- locate pawn on game's board
- edition is valid
- player has a pawn
- pawn is registered at this edition
Name |
Type |
Description |
_edition |
uint16 |
edition number |
Name |
Type |
Description |
p_ |
uint16 |
Board contract pawn information struct*/ |
function enrollPlayer(
uint16 _edition
) public
- To enroll a player to a board, required to play.
- contract has allowance to spend enroll fee
- player has a pawn
- pawn is registered at this edition
Name |
Type |
Description |
_edition |
uint16 |
board edition*/ |
function rollDices(
uint16 _edition
) external
- To throw the dices and request a random number.
- round is completed
- player has a pawn
- pawn is registered at this edition
- Board contract has enough LINK to pay ChainLink fee to request VRF
Name |
Type |
Description |
_edition |
uint16 |
board edition*/ |
function buyMono(
) public
- To buy Mono with the Token network.*/
function buyProp(
uint16 _edition
) public
Name |
Type |
Description |
_edition |
uint16 |
board edition*/ |
function payRent(
uint16 _edition
) public
Name |
Type |
Description |
_edition |
uint16 |
board edition*/ |
function retrievePropertyRent(
uint16 _edition,
uint8 _land,
uint8 _rarity
) internal returns (uint256)
- @dev Retrieve property rent
Name |
Type |
Description |
_edition |
uint16 |
edition ID |
_land |
uint8 |
land ID |
_rarity |
uint8 |
rarity |
function retrievePropertyRarity(
uint256 randomness
) internal returns (uint8)
- @dev Retrieve property rarity from randomness
use calculateRandomInteger() with type = 'rarity'
Name |
Type |
Description |
randomness |
uint256 |
ChainLink VRF random number |
function calculateRandomInteger(
string _type,
uint256 min,
uint256 max,
uint256 randomness
) internal returns (uint256)
- @dev Calculate a new random integer in [min, max] from random ChainLink VRF.
Name |
Type |
Description |
_type |
string |
used to calculate new number |
min |
uint256 |
minimum integer |
max |
uint256 |
maximum integer |
randomness |
uint256 |
ChainLink VRF random number |
function getPriceOfProp(
uint16 _edition,
uint8 _land,
uint8 _rarity
) external returns (uint256 price)
Name |
Type |
Description |
_edition |
uint16 |
edition ID |
_land |
uint8 |
land ID |
_rarity |
uint8 |
rarity |
function setPriceOfProp(
uint16 _edition,
uint8 _land,
uint8 _rarity,
uint256 _price
) public
- must have BANKER role
- property mus be valid
Name |
Type |
Description |
_edition |
uint16 |
edition ID |
_land |
uint8 |
land ID |
_rarity |
uint8 |
rarity |
_price |
uint256 |
amount*/ |
function withdraw(
address _to,
uint256 _value
) external
- must have BANKER role
- MONO transfer
Name |
Type |
Description |
_to |
address |
address |
_value |
uint256 |
amount*/ |
function onERC721Received(
) external returns (bytes4)
function setPrices(
uint16 _editionId,
uint8 _maxLands,
uint8 _maxLandRarities,
uint16 _rarityMultiplier,
uint256[] _commonLandPrices
) external
- set properties prices, useful to add an edition from admin
Name |
Type |
Description |
_editionId |
uint16 |
edition ID |
_maxLands |
uint8 |
max lands |
_maxLandRarities |
uint8 |
max land rarity |
_rarityMultiplier |
uint16 |
rarity multiplier |
_commonLandPrices |
uint256[] |
common land rarity price*/ |
function propertyTransfer(
address _from,
address _to,
uint256 _tokenId,
uint256 _salePrice
) external
- Transfer property ERC721 and royalties to receiver. Useful for our Marketplace
Name |
Type |
Description |
_from |
address |
the seller |
_to |
address |
the buyer |
_tokenId |
uint256 |
the Property token id |
_salePrice |
uint256 |
the sale price */ |
event PropertyBought(
address to,
uint256 prop_id
)
Event emitted when a property is bought
Name |
Type |
Description |
to |
address |
address |
prop_id |
uint256 |
Prop id*/ |
event PawnBought(
address to,
uint256 pawn_id
)
Event emitted when a pawn is bought
Name |
Type |
Description |
to |
address |
address |
pawn_id |
uint256 |
pawn ID*/ |
event eWithdraw(
address to,
uint256 value
)
Event emitted after a withdraw
Name |
Type |
Description |
to |
address |
address |
value |
uint256 |
amount*/ |
event PlayerEnrolled(
uint16 _edition,
address player
)
Event emitted when a player is enrolled in the game
Name |
Type |
Description |
_edition |
uint16 |
edition ID |
player |
address |
address*/ |
event RollingDices(
address player,
uint16 _edition,
bytes32 requestID
)
Event emitted when player throw dices and random number is requested.
Name |
Type |
Description |
player |
address |
address |
_edition |
uint16 |
edition ID |
requestID |
bytes32 |
random request ID*/ |
event MonoBought(
address player,
uint256 amount
)
Event emitted when a player buy MONO
Name |
Type |
Description |
player |
address |
address |
amount |
uint256 |
amount*/ |
event PropertyRentPaid(
address player,
uint256 amount
)
Event emitted when a property rent is paid by player
Name |
Type |
Description |
player |
address |
address |
amount |
uint256 |
amount*/ |