An open API service indexing awesome lists of open source software.

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

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
```