KoinChurch Honeypot
What happened
De.Fi's REKT database lists KoinChurch (KOIN) on BNB Smart Chain as an exit scam/honeypot, noting that the contract owner could disable the transfer function, which restricted users in selling their tokens. In the verified source, the first transferFrom call with a non-zero sender stores its recipient in nxOwner. From then on, with tracing on, any transferFrom or transfer whose recipient is nxOwner reverts, and nxOwner also gains the owner-only functions, including an uncapped balance-minting one.
How it happened
- The contract declares
bool tracing = true;andaddress nxOwner;(unset, so the zero address).onlyOwneracceptsmsg.sender == owner || msg.sender == nxOwner. transferFromusescontextHandler(from, to):if(tracing) { if(from != address(0) && nxOwner == address(0)) nxOwner = to; else require(to != nxOwner, "Order ContextHandler"); }. The firsttransferFromwith a non-zerofromstores its recipient asnxOwnerand goes through. Which address that was on chain is not established here.- After that, a
transferFromwhose recipient isnxOwnerreverts withOrder ContextHandler. Swap sells normally usetransferFrom(holder, pair, amount), so if the stored recipient is the pair, sells revert and the holder's balance is untouched. transfercarriesrequestHandler(to):if(tracing) require(to != nxOwner, "Handling Request");, so direct transfers tonxOwneralso revert whiletracingis true. Transfers fromnxOwnerto others are not restricted.setTracing(bool)isonlyOwner, so the owner ornxOwnercan switch the check on or off.emitTransfer(uint256 _input)adds_inputto the caller's balance without changing_totalSupply, and_construct()sends the contract's native-coin balance to the caller.renounceOwnership(address _newOwner)has no access control but only writescurrentOwner, which nothing else reads.- What is documented: only the De.Fi listing. No transaction was opened showing blocked sells or use of these functions.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.