-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
175 changed files
with
3,713 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Artworld Ethereum | ||
================= | ||
|
||
Ethereum art projects. | ||
|
||
See projects/ for project sources. | ||
|
||
truffle-meteor-build is a build helper script | ||
|
||
Dependencies | ||
------------ | ||
|
||
truffle, meteor, testrpc | ||
|
||
https://github.com/consensys/truffle | ||
|
||
https://www.meteor.com/ | ||
|
||
https://github.com/ConsenSys/eth-testrpc | ||
|
||
Running Locally | ||
--------------- | ||
|
||
In one terminal window, start testrpc: | ||
|
||
testrpc | ||
|
||
In another window, for e.g. is-art: | ||
|
||
cd projects/is-art | ||
truffle deploy | ||
../../truffle-meteor-build | ||
|
||
Then open the UI in a web browser | ||
|
||
chromium environments/development/meteor/index.html | ||
|
||
If you stop testrpc you'll need to deploy again when you restart it. |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Bitmaps | ||
|
||
# Text | ||
|
||
Utf-8. | ||
|
||
# Colours | ||
|
||
24-bit CIELAB. | ||
|
||
# Paths | ||
|
||
Paths are encoded in three bytes: | ||
|
||
opcode, param1, param2 | ||
|
||
Three uint256 variables of these names can be used to store up to 32 path | ||
elements. | ||
|
||
## Opcodes | ||
|
||
### No params | ||
|
||
01 - New Path | ||
10 - Close Path | ||
|
||
### One param | ||
|
||
32 - Repeat next instruction n times (param1) | ||
|
||
### Two Params | ||
|
||
01 - Move To x, y (param1, param2) | ||
02 - Relative Move To +x, +y (param1, param2) | ||
03 - Line To x, y (param1, param2) | ||
04 - Relative Line To +x, +y (param1, param2) | ||
|
||
### Four params | ||
|
||
Two sets of param1, param2, with opcode set to zero. | ||
|
||
05 - Curve To x1, y1, x, y (param1, param2, param1, param2) | ||
06 - Curve To x1, y1, x, y (param1, param2, param1, param2) | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
contract ArtIs { | ||
|
||
struct Definition { | ||
uint8 slot1; | ||
uint8 slot2; | ||
uint8 slot3; | ||
uint8 slot4; | ||
} | ||
|
||
mapping; | ||
|
||
|
||
|
||
;; Constant values | ||
;; Price base (wei), doubled for each definition up to DEFS-COUNT | ||
(def 'PRICE-BASE 10) | ||
;; Add to the index to get the price base exponent | ||
(def 'PRICE-FACTOR-ADD 10) | ||
;; Number of definitions | ||
(def 'DEFS-COUNT 12) | ||
;; Range of values for definitions | ||
(def 'DEF-MIN 0x1) | ||
(def 'DEF-MAX 0x0F0F0F0F) | ||
|
||
;; Storage locations | ||
(def 'artist 0x10) | ||
(def 'defs-base 0x100) | ||
(def 'theorists-base 0x200) | ||
|
||
;; State | ||
;; Contract owner/payee | ||
[[artist]] (caller) | ||
|
||
(return | ||
0x0 | ||
(lll | ||
{ | ||
[action] (calldataload 0) | ||
(when (= @action "set") | ||
{ | ||
[index] (calldataload 32) | ||
[definition] (calldataload 64) | ||
[price] (exp PRICE-BASE (+ @index 1 PRICE-FACTOR-ADD)) | ||
;; If the index is in range and the caller paid enough to set it | ||
(when (&& (>= @definition DEF-MIN) | ||
(<= @definition DEF-MAX) | ||
(< @index DEFS-COUNT) | ||
(= (callvalue) @price)) | ||
{ | ||
;; Update definition | ||
[[(+ defs-base @index)]] @definition | ||
[[(+ theorists-base @index)]] (caller) | ||
(- (gas) 100) @@artist @price 0 0 0 0 | ||
}) | ||
}) | ||
} | ||
0x0)) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
;; Pay to set the aesthetic properties of an artwork (based on your address) | ||
{ | ||
;; Constant values | ||
;; Price increment (wei) | ||
(def 'PRICE-INCREMENT 1000) | ||
|
||
;; Storage locations | ||
(def 'artist 0x10) | ||
(def 'price 0x11) | ||
(def 'aesthetics 0x12) | ||
|
||
;; State | ||
;; Artist | ||
[[artist]] (caller) | ||
;; Price (wei) | ||
[[price]] 1000000 | ||
;; Last setter, also source of colour and shape | ||
[[aesthetics]] (caller) | ||
|
||
(return | ||
0x0 | ||
(lll | ||
{ | ||
[action] (calldataload 0) | ||
(when (&& (= @action "set") | ||
(= (callvalue) @@price) | ||
(not @@(caller))) | ||
{ | ||
;; Record setter, we use their hash to determine aesthetic properties | ||
[[aesthetics]] (caller) | ||
;; Pay artist | ||
(call @@artist (callvalue) 0 0 0 0 0) | ||
;; Record setter, so they cannot set again (artist gets extra freebie) | ||
[[(caller)]] 1 | ||
;; Increment cost of setting | ||
[[price]] (+ [[price]] [[PRICE-INCREMENT]]) | ||
}) | ||
} | ||
0x0))} |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
contract CatalogueRaisonne { | ||
|
||
uint numWorks; | ||
mapping (uint256 => string32) works; | ||
|
||
address artist; | ||
|
||
function CatalogueRaisonne () { | ||
artist = sender; | ||
numWorks = 0; | ||
} | ||
|
||
function addWork (uint256 hash, string32 desc) { | ||
if (msg.sender == artist) { | ||
works[hash] = desc; | ||
numworks++; | ||
} | ||
} | ||
|
||
function checkWork (uint256 hash) returns (bool featured) { | ||
return mapping[hash] != null; | ||
} | ||
|
||
} |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Update to store & use hash of artist and hash (yes, double hash) | ||
|
||
contract CertificateOfAuthenticity { | ||
|
||
address artist; | ||
int32 artworkHash; | ||
|
||
function isAuthentic (address artistCandidate, int32 artworkHashCandidate) | ||
returns (bool authentic) { | ||
return artistCandidate == artist && artworkHashCandidate == artworkHash; | ||
} | ||
|
||
function CertificateOfAuthenticity () { | ||
artist = 0x8802b7f0bfa5e9f5825f2fc708e1ad00d2c2b5d6; | ||
artworkHash = 0x76bba376ea574e63ab357b2374d1cee5aa77d24db38115e3824c5cc4f443d5f7; | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract ConceptualArt { | ||
|
||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.