Skip to content

Commit 71be74b

Browse files
committed
Cutover from Truffle to Hardhat, fixes #27 fixes #30
1 parent 1b9cdc3 commit 71be74b

37 files changed

+5180
-1746
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version-file: ".nvmrc"
20+
cache: "npm"
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Confirm Solidity merged
26+
run: sh test/confirm-sol-merged.sh
27+
28+
- name: Run tests
29+
run: npm test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
build/
22
node_modules/
3+
artifacts/
4+
cache/
5+
types/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

.travis.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

BUG-BOUNTY.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ First, let's give credit to the security researchers that found issues!
1515

1616
## Sponsors
1717

18-
**Sponsor this bug bounty if you support ERC-721**. This means you will commit to pay researchers that demonstrate a problem. Contact us at Su@TenThousandSu.com if interested. Thank you.
18+
**Sponsor this bug bounty if you support ERC-721**. This means you will commit to pay researchers that demonstrate a problem. Contact us at <Su@TenThousandSu.com> if interested. Thank you.
1919

20-
**Now featured on GitCoin, you can check them out here https://twitter.com/GetGitcoin**
20+
**Now featured on GitCoin, you can check them out here <https://twitter.com/GetGitcoin>**
2121

2222
---
2323

@@ -30,19 +30,19 @@ This bounty is open for an unlimited time. Previous limited-time bounty programs
3030

3131
Help us find any problems with this contract and with ERC-721 in general. This bounty program's function scope includes:
3232

33-
- Overflow or break parts of the program
34-
- Steal ownership of a square
35-
- Take over an admin account
36-
- Give a square to somebody else and double spend it or revert it back to your control
37-
- Any undocumented and unintuitive behavior
33+
* Overflow or break parts of the program
34+
* Steal ownership of a square
35+
* Take over an admin account
36+
* Give a square to somebody else and double spend it or revert it back to your control
37+
* Any undocumented and unintuitive behavior
3838

3939
## Rules and rewards
4040

41-
- Issues that have already been published here or are already disclosed to the Su Squares team are not eligible for rewards
42-
- Social engineering, XKCD#538 attacks, bringing down Mainnet/Infura are not in scope and will NOT be paid a reward
43-
- Only the official mainnet contract is in scope, our website is not in scope
44-
- GitHub issues is the only way to report issues and request rewards
45-
- The Su Squares team has complete and final judgement on acceptability of issue reports
41+
* Issues that have already been published here or are already disclosed to the Su Squares team are not eligible for rewards
42+
* Social engineering, XKCD#538 attacks, bringing down Mainnet/Infura are not in scope and will NOT be paid a reward
43+
* Only the official mainnet contract is in scope, our website is not in scope
44+
* GitHub issues is the only way to report issues and request rewards
45+
* The Su Squares team has complete and final judgement on acceptability of issue reports
4646

4747
Following is a risk threat model that judges the impact of an issue based on its likelihood and impact.
4848

@@ -54,36 +54,36 @@ Following is a risk threat model that judges the impact of an issue based on its
5454

5555
Rewards:
5656

57-
- **High severity / highest severity** — you will received two Su Squares on the deployed website (worth $1000 USD)
58-
- **Low / medium / high / highest** — all of these reports will receive an honorable mention, which is also visible from [the Su Squares website](https://tenthousandsu.com)
59-
- Additional rewards may be announced by sponsors? See [sponsors section](#sponsors) above.
57+
* **High severity / highest severity** — you will received two Su Squares on the deployed website (worth $1000 USD)
58+
* **Low / medium / high / highest** — all of these reports will receive an honorable mention, which is also visible from [the Su Squares website](https://tenthousandsu.com)
59+
* Additional rewards may be announced by sponsors? See [sponsors section](#sponsors) above.
6060

6161
Examples of impact:
6262

63-
- High: Steal a square from someone else, impersonate an admin
64-
- Medium: Cause personalization to fail so that the wrong data goes on the blockchain
65-
- Low: Cause a transaction counterparty that carefully reads the contract documentation to make a mistake on some edge case type of transaction
63+
* High: Steal a square from someone else, impersonate an admin
64+
* Medium: Cause personalization to fail so that the wrong data goes on the blockchain
65+
* Low: Cause a transaction counterparty that carefully reads the contract documentation to make a mistake on some edge case type of transaction
6666

6767
How to win:
6868

69-
- Be descriptive and detailed when describing your issue
70-
- Fix it — recommend a way to solve the problem
71-
- Include a Truffle or detailed test case that we can reproduce
69+
* Be descriptive and detailed when describing your issue
70+
* Fix it — recommend a way to solve the problem
71+
* Include a Hardhat or detailed test case that we can reproduce
7272

7373
Rules for bounty sponsor:
7474

75-
- We will respond quickly to your questions (within 2 business days)
76-
- We will adjudicate all prizes quickly (within 5 business days)
77-
- Bounty sponsors are not eligible
75+
* We will respond quickly to your questions (within 2 business days)
76+
* We will adjudicate all prizes quickly (within 5 business days)
77+
* Bounty sponsors are not eligible
7878

7979
## More questions
8080

81-
- Will things change during the bounty program?
82-
- Yes, we are seeking sponsors and will add additional prizes here if that happens.
83-
- Yes, we will update the code and redeploy the contract. So, click STAR and WATCH above on this repo for updates.
84-
- Taxes?
85-
- If sponsors give us so much money that you will need to fill out a tax form, then we will ask you to fill out a tax form. This whole program is subject to the laws of Pennsylvania.
86-
- I read to the bottom of the file.
87-
- That's not even a question. Good, you're the type of person we're seeking. Here's a hint, you can see the [CryptoKitties bounty program](https://github.com/axiomzen/cryptokitties-bounty) and everything that happened there. We stole lots of ideas from them, thank you. And see also [the Su Squares Gitter](https://gitter.im/Su-Squares/Lobby#).
81+
* Will things change during the bounty program?
82+
* Yes, we are seeking sponsors and will add additional prizes here if that happens.
83+
* Yes, we will update the code and redeploy the contract. So, click STAR and WATCH above on this repo for updates.
84+
* Taxes?
85+
* If sponsors give us so much money that you will need to fill out a tax form, then we will ask you to fill out a tax form. This whole program is subject to the laws of Pennsylvania.
86+
* I read to the bottom of the file.
87+
* That's not even a question. Good, you're the type of person we're seeking. Here's a hint, you can see the [CryptoKitties bounty program](https://github.com/axiomzen/cryptokitties-bounty) and everything that happened there. We stole lots of ideas from them, thank you. And see also [the Su Squares Gitter](https://gitter.im/Su-Squares/Lobby#).
8888

89-
Copyright 2018 William & Su Entriken. All rights reserved.
89+
Copyright 2018 William & Su Entriken. All rights reserved.

DEPLOY.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
*This is the full process for deploying a new version of the Su Squares smart contract. It costs money, it is painful. Measure twice, cut once!*
44

5-
1. :warning: Warn the public at https://tenthousandsu.com
5+
1. :warning: Warn the public at <https://tenthousandsu.com>
66
2. Edit code in the contracts folder
77

88
1. Recompile `ALLINONE.sol` file, make sure it matches (automated build test)
@@ -13,9 +13,9 @@
1313
1. Delete all storage, add ALLINONE.sol, select `SuMain`, enable optimization, compile
1414

1515
1. Save code to Gist (workaround for Etherscan bug)
16-
2. Save the bytecode to `bytecode.json`, this is a release artifact
17-
3. Save the ABI to `abi.json`, this is a release artifact
18-
4. Record the compiler version number
16+
1. Save the bytecode to `bytecode.json`, this is a release artifact
17+
1. Save the ABI to `abi.json`, this is a release artifact
18+
1. Record the compiler version number
1919
4. Use Remix IDE with CEO account to deploy contract
2020
1. Record the deployed address
2121
2. `setFinancialOfficer` `"0x7Ca2Cf38e9dbB925e584398E5D63F1A8F0B731f9"`
@@ -39,8 +39,8 @@
3939
2. Update address in the white paper (NOTE OLD ADDRESS)
4040
3. Remove any (WE ARE UPGRADING) note on index.html
4141
9. Tell the world
42-
1. Make a release on smart contract GitHub project / add release artifacts / update the project URL to new etherscan contract https://github.com/su-squares/ethereum-contract
43-
2. Update address at https://github.com/MyEtherWallet/ethereum-lists/blob/master/contracts/contract-abi-eth.json
42+
1. Make a release on smart contract GitHub project / add release artifacts / update the project URL to new etherscan contract <https://github.com/su-squares/ethereum-contract>
43+
2. Update address at <https://github.com/MyEtherWallet/ethereum-lists/blob/master/contracts/contract-abi-eth.json>
4444
3. Relist opensea
4545
4. Relist coingecko
4646
5. Email anybody that bought squares, if I know them somehow

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Read the full [deployment process documentation](DEPLOY.md).
3131

3232
You are somebody that reads documentation on smart contracts and understands how Su Squares works. So you have unique skills and your time is valuable. We will pay you for your contributions to Su Squares in the form of bug reports.
3333

34-
If your project depends on ERC-721 or you want to help improve the assuarance of this project then you can pledge a bounty. This means you will commit to pay researchers that demonstrate a problem. Contact us at Su@TenThousandSu.com if interested. Thank you.
34+
If your project depends on ERC-721 or you want to help improve the assuarance of this project then you can pledge a bounty. This means you will commit to pay researchers that demonstrate a problem. Contact us at <Su@TenThousandSu.com> if interested. Thank you.
3535

3636
Read the full [bug bounty program](BUG-BOUNTY.md).
3737

contracts/Migrations.sol

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pragma solidity ^0.4.24;
2+
import "../AccessControl.sol";
3+
4+
contract AccessControlTestMock is AccessControl {
5+
constructor() public {}
6+
7+
function anExecutiveTask() external view onlyExecutiveOfficer {}
8+
9+
function anOperatingTask() external view onlyOperatingOfficer {}
10+
11+
function aFinancialTask() external view onlyFinancialOfficer {}
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pragma solidity ^0.4.24;
2+
import "../SuNFT.sol";
3+
4+
contract SuNFTStealableTestMock is SuNFT {
5+
constructor() public {}
6+
7+
function stealSquare(uint256 nftId) external {
8+
_transfer(nftId, msg.sender);
9+
}
10+
}

0 commit comments

Comments
 (0)