https://github.com/masdxi/right-to-left-attack-solidity
An example of right to left attack on smart contract
https://github.com/masdxi/right-to-left-attack-solidity
rtlo security smart-contracts solidity
Last synced: 13 days ago
JSON representation
An example of right to left attack on smart contract
- Host: GitHub
- URL: https://github.com/masdxi/right-to-left-attack-solidity
- Owner: MASDXI
- Created: 2022-04-05T10:58:45.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-28T09:41:09.000Z (about 4 years ago)
- Last Synced: 2025-06-06T10:41:57.961Z (12 months ago)
- Topics: rtlo, security, smart-contracts, solidity
- Language: JavaScript
- Homepage:
- Size: 162 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Right to left override contract
Explain [New Language, Same old mistake](https://coinsbench.com/the-new-language-but-the-old-mistake-33831bfce25e)
Tutorial using Hardhat(Buidler) to complie, deploy and automated unit tests Solidity smart contract.
you can use this project for learning
To run these tutorials, you must have the following installed:
- [nodejs](https://nodejs.org/en/)
- [nvm](https://github.com/nvm-sh/nvm)
```bash
$ yarn install
```
to compile your smart contract to get an ABI and artifact of a smart contract.
```bash
$ yarn compile
```
for a unit testing smart contract using the command line.
```
$ yarn test:guessnumber
```
expecting `guess-number.js` result.
```bash
$ npx hardhat test test/guess-number.test.js
GuessTheNumber
✔ Guess should be failed
1) Guess should be success
✔ getValue initialized contract balance
✔ getValue after someone guess the number
3 passing (247ms)
1 failing
1) GuessTheNumber
Guess should be success:
AssertionError: Expected event "success" to be emitted, but it wasn't
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
after testing if you want to deploy the contract using the command line.
```bash
$ yarn rpc
$ yarn exploit
```