Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feralfile Exhibition V4 #19

Merged
merged 50 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5af4d3b
Implemented buyArtworks function
tienngovan Jun 5, 2023
8b02210
Fixed prettier issue
tienngovan Jun 6, 2023
caaf8c1
Implemented buy artwork with paid by vault contract
tienngovan Jun 6, 2023
875a9af
Remove ipfs from mint & add vault contract support
lpopo0856 Jun 6, 2023
1df88f3
better test language
lpopo0856 Jun 6, 2023
46a4fa1
add test for vault
lpopo0856 Jun 6, 2023
7e8c13a
fixed conflict
tienngovan Jun 6, 2023
043d054
fixed revenue and cost
tienngovan Jun 6, 2023
3c663e8
Add prettier github action
lemonlatte Jun 7, 2023
d468d6d
Fix the cost transfer logic
lpopo0856 Jun 7, 2023
9521dba
Better cost sending condition
lpopo0856 Jun 7, 2023
39c2475
Merge pull request #20 from bitmark-inc/remove-ipfs-and-add-vault-con…
lpopo0856 Jun 7, 2023
f6e7848
send remaining funds to cost addr
lpopo0856 Jun 7, 2023
e48f7fc
Merge pull request #22 from bitmark-inc/handle-remaining-funds
lpopo0856 Jun 7, 2023
b3b0f98
add vault contract signature validation
lpopo0856 Jun 7, 2023
6ce78d2
make signer private
lpopo0856 Jun 7, 2023
0ef7594
Fix signer logic
lpopo0856 Jun 7, 2023
70d8477
adding paid lock
lpopo0856 Jun 7, 2023
1b22ff8
adding withdraw function to exhibition contract
lpopo0856 Jun 7, 2023
97e06a8
update gitginore
jollyjoker992 Jun 5, 2023
40ad906
Add prettier github action
lemonlatte Jun 7, 2023
cf97c81
add mint functions
jollyjoker992 Jun 6, 2023
5166620
some minor fixes
jollyjoker992 Jun 7, 2023
538fbe9
minor fixes
jollyjoker992 Jun 8, 2023
94dc849
update test cases
jollyjoker992 Jun 8, 2023
22bdc57
fix conflict error
jollyjoker992 Jun 8, 2023
fc80bc9
fix prettier merge
jollyjoker992 Jun 8, 2023
87b81b1
Merge pull request #21 from bitmark-inc/mint-token
jollyjoker992 Jun 8, 2023
7879bef
Merge remote-tracking branch 'origin/FF_V4' into sig-validation-for-v…
lpopo0856 Jun 8, 2023
652022a
Fix testing and more comments
lpopo0856 Jun 8, 2023
ad9e773
better testing
lpopo0856 Jun 8, 2023
efdc296
follow the private naming
lpopo0856 Jun 8, 2023
b65bbd3
fix PR review
lpopo0856 Jun 8, 2023
8446f84
create seperate public address for vault
lpopo0856 Jun 8, 2023
2a1f8ea
introduce necessary interface
lpopo0856 Jun 8, 2023
ff072f1
add more test case to vault
lpopo0856 Jun 8, 2023
9a980d7
remove unused vault var
lpopo0856 Jun 8, 2023
08ec7aa
add contractURI to constructor
jollyjoker992 Jun 8, 2023
5788928
Merge remote-tracking branch 'origin/FF_V4' into sig-validation-for-v…
lpopo0856 Jun 8, 2023
0a1b627
Merge pull request #23 from bitmark-inc/sig-validation-for-vault
lpopo0856 Jun 9, 2023
2b9a133
Add migration to deploy
lpopo0856 Jun 9, 2023
b4b68c5
add function to stop sale along with handling remaining token
jollyjoker992 Jun 20, 2023
7dea8e0
update access specifier
jollyjoker992 Jun 20, 2023
842e9c4
don't allow to send token to the contract
jollyjoker992 Jun 21, 2023
4d1ca3c
add some transfer tests
jollyjoker992 Jun 21, 2023
df9c093
fix wrong condition for stop sale and transfer
jollyjoker992 Jun 21, 2023
c24e4fc
update error message
jollyjoker992 Jun 23, 2023
8b8ef33
add more checks for stopSaleAndTransfer and burnArtworks
jollyjoker992 Jun 26, 2023
083f1f4
add some validations
jollyjoker992 Jun 27, 2023
78295a7
remove tokenBaseURI from constructor, fix migration scripts
jollyjoker992 Jun 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: prettier
on:
push:
pull_request:

jobs:
prettier:
name: prettier
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Prettify code
uses: creyD/[email protected]
with:
# This part is also where you can pass other options, for example:
prettier_options: --check contracts/FeralfileArtworkV4.sol
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
build
node_modules
coverage/*
coverage.json
coverage.json
46 changes: 46 additions & 0 deletions contracts/ECDSASigner.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract ECDSASigner is Ownable {
address private _signer;

constructor(address signer_) {
require(signer_ != address(0), "ECDSASign: signer_ is zero address");
_signer = signer_;
}

/// @notice isValidSignature validates a message by ecrecover to ensure
// it is signed by signer.
/// @param message_ - the raw message for signing
/// @param r_ - part of signature for validating parameters integrity
/// @param s_ - part of signature for validating parameters integrity
/// @param v_ - part of signature for validating parameters integrity
function isValidSignature(
bytes32 message_,
bytes32 r_,
bytes32 s_,
uint8 v_
) internal view returns (bool) {
address reqSigner = ECDSA.recover(
ECDSA.toEthSignedMessageHash(message_),
v_,
r_,
s_
);
return reqSigner == _signer;
}

/// @notice set the signer
/// @param signer_ - the address of signer
function setSigner(address signer_) external onlyOwner {
require(signer_ != address(0), "ECDSASign: signer_ is zero address");
_signer = signer_;
}

function signer() external view returns (address) {
return _signer;
}
}
Loading