IMilitary

Git Source

Functions

deposit

function deposit(uint256 amount_) external;

join

function join(uint256 charId_) external;

leave

function leave(uint256 charId_) external returns (uint256 rewards_);

leave

function leave(uint256 charId_, address owner_, uint256 charPower_) external;

increasePower

function increasePower(uint256 charId_, address owner_, uint256 oldPower_, uint256 powerChange_) external;

getRewards

function getRewards(uint256 charId_) external returns (uint256 rewards_);

previewRewards

function previewRewards(uint256 charId_) external view returns (uint256);

isCharEnlisted

function isCharEnlisted(uint256 charId_) external view returns (bool);

Events

Deposited

event Deposited(uint256 amount_, uint256 expireTimestamp_);

Joined

event Joined(uint256 indexed charId_, uint256 power_);

Left

event Left(uint256 indexed charId_, uint256 rewards_);

PowerIncreased

event PowerIncreased(uint256 indexed charId_, uint256 powerChange_);

TotalPowerUpdated

event TotalPowerUpdated(uint256 totalPower_);

FirstExpiringDepositUpdated

event FirstExpiringDepositUpdated(uint256 index);

GoldPerPowerofCharUpdated

event GoldPerPowerofCharUpdated(uint256 indexed charId_, uint256 goldPerPower_);

GoldPerPowerUpdated

event GoldPerPowerUpdated(uint256 goldPerPower_);

GoldBurned

event GoldBurned(uint256 amount_);

TotalDepositedUpdated

event TotalDepositedUpdated(uint256 totalDeposited_);

RewardsClaimed

event RewardsClaimed(uint256 indexed charId_, uint256 rewards_);

Errors

NotBankError

error NotBankError(address msgSender_);

NotCharacterError

error NotCharacterError(address msgSender_);

NotCharOwnerError

error NotCharOwnerError(uint256 charId_, address msgSender_);

AlreadyEnlistedError

error AlreadyEnlistedError(uint256 charId_);

Structs

Deposit

struct Deposit {
    uint192 amount;
    uint64 expireTimestamp;
}

CharInfo

struct CharInfo {
    uint224 goldPerPower;
    uint32 power;
}