Omniscia Bluejay Finance Audit

BondRouter Manual Review Findings

BondRouter Manual Review Findings

BRR-01M: Inexistent Validation of Bond Existence

Description:

The _burn function does not validate that the tokenId specified exists in the _ownedBonds set of its owner, permitting the "successful" deletion of inexistent bonds.

Example:

packages/contracts/contracts/BondRouter.sol
62function _burn(uint256 tokenId) internal {
63 _ownedBonds[bondOwner[tokenId]].remove(tokenId);
64 delete bonds[tokenId];
65 delete bondOwner[tokenId];
66}

Recommendation:

We advise a require check to be imposed that ensures the bool yielded by the remove function is true thereby guaranteeing that the bond was successfully removed from its owner.

Alleviation:

A require check was introduced wrapping the remove function execution and thus properly validating that the bond entry removed indeed existed.

BRR-02M: Inexplicable Capability of Re-Invocation

Description:

The linked function permits the staking address of the Bluejay token to be set arbitrarily by the owner.

Example:

packages/contracts/contracts/BondRouter.sol
215// Admin Functions
216function setStakingAddress(address _sblu) public onlyOwner {
217 sBLU = IStakedToken(_sblu);
218}

Recommendation:

Given that the contract is already an upgrade-able implementation, we advise the sBLU token to be settable only once and if a change is required which should be seldom it is performed via a contract upgrade to properly signal the community of the change.

Alleviation:

The function has been omitted from the codebase thereby alleviating this exhibit.