This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Feat/struct pixel#24
Open
joshualyguessennd wants to merge 18 commits into
Open
Conversation
Comment on lines
+142
to
+160
| function sellLandToBank(uint256[] memory _tokenIds) external nonReentrant { | ||
| uint256 numberOfPx = _tokenIds.length; | ||
| uint256 amountToSend; | ||
| uint256 i; | ||
| unchecked { | ||
| amountToSend = | ||
| ILandNFT(landNft).totalTileNum() * | ||
| ILandNFT(landNft).getLength(_tokenId); | ||
| amountToSend = getPrice() * numberOfPx; | ||
| } | ||
| IERC20(RIO_TOKEN).transfer( | ||
| _seller, | ||
| (IERC20(RIO_TOKEN).balanceOf(address(this)) / amountToSend) | ||
| ); | ||
|
|
||
| for (i; i < numberOfPx; i++) { | ||
| ILandNFT(landNft).transferFrom( | ||
| msg.sender, | ||
| address(this), | ||
| _tokenIds[i] | ||
| ); | ||
| timelapse[_tokenIds[i]] = block.timestamp; | ||
| } | ||
| IERC20(RIO_TOKEN).transfer(msg.sender, amountToSend); | ||
| emit LandSold(msg.sender, _tokenIds, amountToSend, block.timestamp); | ||
| } |
Check notice
Code scanning / Slither
Calls inside a loop
Comment on lines
+142
to
+160
| function sellLandToBank(uint256[] memory _tokenIds) external nonReentrant { | ||
| uint256 numberOfPx = _tokenIds.length; | ||
| uint256 amountToSend; | ||
| uint256 i; | ||
| unchecked { | ||
| amountToSend = | ||
| ILandNFT(landNft).totalTileNum() * | ||
| ILandNFT(landNft).getLength(_tokenId); | ||
| amountToSend = getPrice() * numberOfPx; | ||
| } | ||
| IERC20(RIO_TOKEN).transfer( | ||
| _seller, | ||
| (IERC20(RIO_TOKEN).balanceOf(address(this)) / amountToSend) | ||
| ); | ||
|
|
||
| for (i; i < numberOfPx; i++) { | ||
| ILandNFT(landNft).transferFrom( | ||
| msg.sender, | ||
| address(this), | ||
| _tokenIds[i] | ||
| ); | ||
| timelapse[_tokenIds[i]] = block.timestamp; | ||
| } | ||
| IERC20(RIO_TOKEN).transfer(msg.sender, amountToSend); | ||
| emit LandSold(msg.sender, _tokenIds, amountToSend, block.timestamp); | ||
| } |
Check notice
Code scanning / Slither
Reentrancy vulnerabilities
Comment on lines
+142
to
+160
| function sellLandToBank(uint256[] memory _tokenIds) external nonReentrant { | ||
| uint256 numberOfPx = _tokenIds.length; | ||
| uint256 amountToSend; | ||
| uint256 i; | ||
| unchecked { | ||
| amountToSend = | ||
| ILandNFT(landNft).totalTileNum() * | ||
| ILandNFT(landNft).getLength(_tokenId); | ||
| amountToSend = getPrice() * numberOfPx; | ||
| } | ||
| IERC20(RIO_TOKEN).transfer( | ||
| _seller, | ||
| (IERC20(RIO_TOKEN).balanceOf(address(this)) / amountToSend) | ||
| ); | ||
|
|
||
| for (i; i < numberOfPx; i++) { | ||
| ILandNFT(landNft).transferFrom( | ||
| msg.sender, | ||
| address(this), | ||
| _tokenIds[i] | ||
| ); | ||
| timelapse[_tokenIds[i]] = block.timestamp; | ||
| } | ||
| IERC20(RIO_TOKEN).transfer(msg.sender, amountToSend); | ||
| emit LandSold(msg.sender, _tokenIds, amountToSend, block.timestamp); | ||
| } |
Check notice
Code scanning / Slither
Reentrancy vulnerabilities
* api balanceOf, owner * owner * service owner * update cargo * fix url * totalsupply * init mint * mint tx issue * mint tx issue * region struct * feat: adds mint route * connect wallet * fix: provider instatition * feat: Json field * approve logic * sign tx * tx request * send_tx option * chore: signer middleware * chore: mint * fix: unwrap over ? * fix: unwrap over ? * mint * error some string * migrate to service * fix: approval call * await approval * chore: refactor for tests * set bank, dev * feat: adds docker build * chore: fix env var * test balance * provider refactoring * fix dotenv * comment mint debug * appstate * refactor: split provider out * Docker service * fix: lint * clippy fix * cargo fmt * update * check env * delete foundry step * slither ci * exclude lib * exclude lib * exclude lib * anvil test * reduce time * feat: deploymnent script * feat: test update, script * Feat/deployments testnet (#27) * feat: init landbank logic * feat: function buyFromBank * feat: test buy from bank * add getTokenPrice * feat: update getTokenPrice * feat: landBank contract + test * add select struct logic * feat: remove unnecessary comment * deployment * erros packed * slither redondant fix * remove unused * import format * remove double toml * toml file * delete unused toml * fix binding * feat: fix binding compile process * update src * path landbank * path tests * path nft test * remove working directory * remove absolue path * fix case-sensitive * bindings * add package * bindings Co-authored-by: joshualyguessennd <joshualyguessennd@icloud.com> Co-authored-by: joshualyguessennd <75019812+joshualyguessennd@users.noreply.github.com>
558627e to
030d573
Compare
| mapping(uint256 => ILandNFT.Pixel) pixelsId; | ||
| mapping(uint256 => ILandNFT.Pixel) private pixelsId; | ||
| mapping(bytes32 => bool) private isSpecialArea; | ||
| mapping(bytes32 => bool) private areaClaimed; |
Check failure
Code scanning / Slither
Uninitialized state variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.