Smart contracts
The smart contract project PuttyV2 used Solidity version 0.8.13, which contains two known compiler bugs: one in ABI encoding and one in the optimiser's handling of inline assembly. An attacker could potentially exploit these bugs to cause incorrect behaviour in the contract, though the report does not demonstrate a concrete exploit.
PU
Putty
Medium
Business logic
The fee for options was calculated as a fraction of the strike price, so zero-strike calls incurred no fee and deep out-of-the-money calls incurred disproportionately high fees. An attacker could avoid paying system fees by using zero-strike call options.
PU
Putty
Medium
Business logic
Order cancellation requires calling a function with the full order parameters, which are stored in a centralised database. If that database goes offline, makers cannot cancel, and an attacker with a copy of the orders could fill them on favourable terms.
PU
Putty
Medium
Business logic
A maker could create an order with a zero duration, causing it to expire immediately after a taker fills it. The taker would then be forced to withdraw at a loss due to fees on the strike price.
PU
Putty
Medium
DoS
The fee calculation in PuttyV2 can round down to zero for small strike prices, causing a zero-value ERC-20 transfer that reverts for certain tokens. This prevents withdrawal of assets and the strike, locking them in the contract.
PU
Putty
Medium
Business logic
Fees are applied only when a user withdraws, so the contract owner could raise the fee after an order was agreed and filled, and users would then pay the higher rate on withdrawal. This could cause users to lose funds they expected to keep, since they would not have entered the order at the higher fee.
PU
Putty
Medium
Access control
The Putty protocol mints ERC721 position tokens using an unsafe mint function that does not verify the recipient can handle ERC721 tokens. If a maker or taker is a contract unable to receive ERC721 tokens, their position tokens may become locked and nontransferable, preventing them from exercising or withdrawing assets.
PU
Putty
Medium
Race condition
The PuttyV2 contract allows a malicious contract to act as both maker and taker in a fillOrder, using a custom ERC20 token to pay the fee and reentering to exercise an option, thereby obtaining assets without paying a real fee. This enables flashloan-like access to the contract's assets for profit.
PU
Putty
Medium
Business logic
The contract's order parameters allow an ERC721 token address to be used where an ERC20 token is expected because both token standards share the same transferFrom function signature. An attacker could fill an order with an ERC721 as the base or ERC20 asset, causing the NFT to be transferred into the contract but then permanently stuck because the outgoing transfer uses an ERC20-specific function.
PU
Putty
Medium
Business logic
A short put option order could be created using an NFT that does not implement the ERC721 receiver callback, such as CryptoPunk. A buyer who fulfils the order pays the premium but can never exercise the option because the transfer call fails, letting the attacker keep the premium and recover the asset after expiry.
PU
Putty
Medium
DoS
The contract owner could block users from withdrawing their strike by making the fee transfer revert, either by setting the owner address to zero or by using an ERC777 token that rejects the fee. This would cause the entire withdrawal to fail, leaving users' assets stuck in the contract.
PU
Putty
Medium
Business logic
The fillOrder() and exercise() functions are payable and accept Ether even when the code path does not require it, so any Ether sent is locked in the contract forever. An attacker could not directly exploit this, but a user could accidentally lose funds by sending Ether when it is not needed.
PU
Putty
Medium
Business logic
The protocol failed to deduct fees when a put option was exercised, so put options were free of fees. An attacker could exercise put options without paying the protocol fee, causing the protocol to leak value.
PU
Putty
Medium
Business logic
A put option seller could include a zero amount or a non-existent token in the order's ERC20 asset list, causing the buyer's exercise transaction to revert. The buyer would then be unable to exercise the option and would lose the premium paid.
PU
Putty
Medium
DoS
The smart contract functions that transfer assets out during exercise or withdrawal loop over an unbounded number of assets, so if gas costs rise or assets are gas-heavy, the transaction can fail due to block gas limit. An attacker could create an order with many assets, causing the buyer to pay the premium but be unable to receive the assets.
PU
Putty
Medium
Business logic
A maker could include a malicious token contract in an order, which would revert when the taker tried to exercise or withdraw, locking the taker's assets. The attacker could then wait until the option expired or the price moved in their favour before allowing transfers.
PU
Putty
Medium
Business logic
The exercise function unconditionally transfers the strike amount, which fails for ERC20 tokens that revert on zero-value transfers. A malicious maker can create a zero-strike call option with such a token, collect the premium, and wait for expiry since the taker cannot exercise, allowing the maker to steal the premium.
PU
Putty
High
Business logic
A short call option order with a non-empty floorTokens array cannot be exercised by the taker and cannot be withdrawn by the maker after expiry, locking the maker's ERC20 and ERC721 assets. An attacker could also grief other users by filling a short call with floor tokens that match another user's long call, causing that other user's option to become unexercisable and their funds locked.
PU
Putty
High
Race condition
The acceptCounterOffer function cancels the original order but does not check if it has already been filled, allowing an attacker to front-run and fill the original order before cancellation. This results in both the original and counter orders being filled, doubling the user's intended leverage.
PU
Putty
High
Business logic
The fee logic in PuttyV2.sol incorrectly deducts a fee from the strike when a put option expires unexercised, and fails to deduct a fee when a put option is exercised. This causes a loss of assets for the put shorter and a loss of protocol revenue.
PU
Putty
High