Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
7060243
matic price event
mcplums Aug 16, 2021
1ada9bf
Kanye event
mcplums Aug 17, 2021
20ec740
Revert "Kanye event"
Splidge Aug 18, 2021
27ec0bc
Revert "matic price event"
Splidge Aug 18, 2021
99aafff
Merge pull request #117 from RealityCards/dc/master
Splidge Sep 2, 2021
9182219
update RCFull
Splidge Sep 2, 2021
d4a19ca
PreMint on NftHub L1
Splidge Sep 3, 2021
c08d546
added comment
kostyade Sep 3, 2021
34981d4
Merge pull request #127 from RealityCards/kd/L1PreMint
Splidge Sep 3, 2021
bd27e9e
V1 market deployment updates
Splidge Sep 4, 2021
e4f326b
improve approving artists
Splidge Sep 8, 2021
59c75ee
Graph testing adjustments
vladmee Sep 8, 2021
7901247
Merge pull request #128 from RealityCards/vm/migration-adjustments
Splidge Sep 8, 2021
48c055c
Merge pull request #129 from RealityCards/dc/master
kostyade Sep 9, 2021
03a2033
check !accountingComplete on newRental
Splidge Sep 10, 2021
1dbd57b
add description to event.json
Splidge Sep 11, 2021
4cbc257
make L1 NFT hub Ownable
Splidge Sep 13, 2021
444d939
catch user not affording first card up to lastRentCalc
Splidge Sep 15, 2021
25e183c
Merge commit '03a2033f975c48ff07cb55c3db2074a46bbb5459' into dc/master
Splidge Sep 15, 2021
d68999d
Merge commit '1dbd57b2ffe2c65f4c4e28448e124ff91a256201' into dc/master
Splidge Sep 15, 2021
1a0cd28
update factory
Splidge Sep 15, 2021
3ebc6d7
add a basic rent collector
Splidge Sep 24, 2021
5a09a78
Improve date checks
Splidge Sep 24, 2021
246ea63
rentCollector improvements
Splidge Oct 6, 2021
e677cec
Fix small error in the testing migration code
vladmee Oct 6, 2021
b62abcf
store token jsons on ipfs
Splidge Oct 8, 2021
a498e29
Merge commit 'b62abcf0bf5a4ee3a3e56bef0612304bef7e99c6' into dc/master
Splidge Oct 8, 2021
2a76980
add mulitple image sizes
Splidge Oct 8, 2021
e96400e
Merge commit '2a769807840b13a4c63c868b25ed1658e67bbd3a' into dc/master
Splidge Oct 8, 2021
f9f129f
clear default values
Splidge Oct 8, 2021
0c5fe9b
test Achievements contract
Splidge Oct 26, 2021
6d061f8
deploy achievements contract
Splidge Nov 3, 2021
82e6fee
add Giveaway type and text
Splidge Nov 4, 2021
04679e3
make prettier
Splidge Nov 4, 2021
ff3565f
Collect user rent before newRental
Splidge Nov 8, 2021
89653a6
add chainlink
Splidge Nov 10, 2021
a0bf7d0
add `card` to interface
Splidge Nov 10, 2021
cd3ea80
Revert "Hashcloak, simplify rent collection"
Splidge Nov 15, 2021
84d5607
test for rent returned after locking
Splidge Nov 16, 2021
44841c5
return rent after market locking
Splidge Nov 16, 2021
96d90ab
add giveaway contact
Splidge Nov 16, 2021
84068ad
Inherit Upgradable Initializable.sol
Splidge Dec 1, 2021
f0fd312
make achievments upgradable
Splidge Dec 8, 2021
5bc3166
Generate OG and Print tokenURIs
Splidge Dec 8, 2021
62c3482
add start and end attributes
Splidge Dec 8, 2021
71163ee
hyphenate token.json for readability
Splidge Dec 8, 2021
1cd11b6
clear eventmaker form
Splidge Dec 8, 2021
87f7c07
create update tokenURI script
Splidge Dec 9, 2021
1270e04
update comment
Splidge Dec 9, 2021
636e800
final touches to tokenURI script
Splidge Dec 10, 2021
3058120
add artist name
Splidge Dec 10, 2021
178f81f
save old jsons
Splidge Dec 10, 2021
14c87f8
ignore output folder
Splidge Dec 10, 2021
8101395
output correct artist_address variable
Splidge Dec 13, 2021
b283eb8
add suffixes to card types
Splidge Dec 14, 2021
705a9a9
no need to save old JSONs
Splidge Dec 21, 2021
a922662
basic collect payments script
Splidge Dec 21, 2021
25f34c2
Add Hardhat Tracer plugin
Splidge Jan 10, 2022
bdf69e0
Improve rent refund tests
Splidge Jan 10, 2022
3a00456
add basic user payment log
Splidge Jan 10, 2022
2ce5413
lock market on first rent collection post `marketLockingTime`
Splidge Jan 10, 2022
9b48895
add etherscan plugin
Splidge Jan 12, 2022
4c326e2
add secret sauce
Splidge Mar 17, 2022
fde27ff
add tokenId to `achievementAwarded`
Splidge Mar 17, 2022
09de6d8
remove UUPS proxy
Splidge Mar 17, 2022
0fe7567
Add OZ upgrades
Splidge Mar 18, 2022
4ca5ea3
Deploy achievments as upgradable
Splidge Mar 18, 2022
d4d375c
Update 2_deploy_contracts.js
kostyade Mar 21, 2022
b590495
only allow an address to claim an achievement once
Splidge Mar 22, 2022
144f39a
Revert "Add OZ upgrades"
Splidge Mar 28, 2022
bdc9602
Merge commit 'd4d375c14f79bfa67914aeda593534d32d797edd' into dc/master
Splidge Mar 28, 2022
0f95382
Merge branch 'dc/master' into client/1
Splidge Mar 28, 2022
46a5bef
Merge pull request #136 from RealityCards/client/1
Splidge Mar 28, 2022
8991656
Add a ERC20 token for Dev testing
Splidge Apr 5, 2022
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ events/
.solcover.js
coverage.json
contracts/artifacts/
output/

# buidler
artifactsBuidler/
Expand Down
137 changes: 106 additions & 31 deletions EventMaker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
START_TIME=""
END_TIME=""
SPONSORSHIP="0"
ARTIST=""
ARTIST_NAME=""
ARTIST_ADDRESS=""
ARTIST_LINK=""
EVENT_NAME=""
ORACLE_QUESTION=""
DESCRIPTION=''
SRC_NAME=""
SLUG=""
CATEGORY="Other"
US_ALLOWED="true"
IMAGE_FORMAT=".jpg"
IMAGE_FORMAT=".png"
NUMBER_OF_CARDS=""
CARD0=""
CARD1=""
Expand All @@ -23,28 +25,41 @@ CARD3=""
CARD4=""
CARD5=""
CARD6=""
GIVEAWAY_TYPE=""
GIVEAWAY_TEXT=""
AFFILIATE=""
CARD_AFFILIATE0=""
CARD_AFFILIATE1=""
CARD_AFFILIATE2=""
CARD_AFFILIATE3=""
CARD_AFFILIATE4=""
CDN="https://cdn.realitycards.io/"
IMAGES="images/"
NFT="nftmetadata/"
IMAGES="V1/"
NFT="V1/"
ZERO_ADDRESS="0x0000000000000000000000000000000000000000"
##################

# remove quotation marks (replace with apostophies)
DESCRIPTION=${DESCRIPTION//\"/\'}
# remove newlines
DESCRIPTION=${DESCRIPTION//$'\n'/}

mkdir -p events/$SRC_NAME
eventJSON='{\n "name": "'$EVENT_NAME'",'
eventJSON=$eventJSON'\n "slug": "'$SLUG'",'
if [ "$ARTIST_LINK" == "" ];then
echo WARNING: ARTIST LINK NOT SET
else
eventJSON=$eventJSON'\n "artistLink": "'$ARTIST_LINK'",'
eventJSON=$eventJSON'\n "artistLink": "'$ARTIST_LINK'",'
fi
if [ "$ARTIST_NAME" == "" ];then
echo WARNING: ARTIST NAME NOT SET
else
eventJSON=$eventJSON'\n "artistName": "'$ARTIST_NAME'",'
fi
eventJSON=$eventJSON'\n "category": "'$CATEGORY'",'
eventJSON=$eventJSON'\n "US_allowed": "'$US_ALLOWED'",'
eventJSON=$eventJSON'\n "description": "'$DESCRIPTION'",'
eventJSON=$eventJSON'\n "cards": {'
for ((i=0;i<$NUMBER_OF_CARDS;i++))
do
Expand All @@ -59,24 +74,86 @@ do
eventJSON=$eventJSON'\n }'
fi
done
if [ "$GIVEAWAY_TEXT" == "" ];then
if [ "$GIVEAWAY_TYPE" == "" ];then
echo NO GIVEAWAY TYPE SET
eventJSON=$eventJSON'\n }'
fi
else
eventJSON=$eventJSON'\n },'
eventJSON=$eventJSON'\n "giveaway": {'
eventJSON=$eventJSON'\n "type": "'$GIVEAWAY_TYPE'",'
eventJSON=$eventJSON'\n "text": "'$GIVEAWAY_TEXT'"'
eventJSON=$eventJSON'\n }'
fi
eventJSON=$eventJSON'\n}'

echo -e "$eventJSON" > events/$SRC_NAME/event.json

# now make the token.json files
## now make the token.json files ##
TOKEN_URIS='['

for ((i=0;i<$NUMBER_OF_CARDS;i++))
for ((j=0;j<5;j++))
do
card='CARD'$i
cardJSON='{\n "name": "'${!card}'",'
cardJSON=$cardJSON'\n "description": "This token represents a stake in the outcome '"'"$EVENT_NAME"'"
cardJSON=$cardJSON' at Reality Cards, the planet'"'"'s first NFT-based prediction market",'
cardJSON=$cardJSON'\n "image": "'$CDN$IMAGES$SRC_NAME'/'${!card// /-}$IMAGE_FORMAT'",'
cardJSON=$cardJSON'\n "affiliation": "Reality Cards"'
cardJSON=$cardJSON'\n}'

echo -e "$cardJSON" > events/$SRC_NAME/token$i.json

case "$j" in
0) cardType="OG-Neutral" suffix="";;
1) cardType="OG-Winner" suffix=".winner";;
2) cardType="OG-Loser" suffix=".loser";;
3) cardType="Print-Winner" suffix=".winningPrint";;
4) cardType="Print-Loser" suffix=".losingPrint";;
esac


for ((i=0;i<$NUMBER_OF_CARDS;i++))
do
card='CARD'$i
cardJSON='{\n "name": "'${!card}'",'
cardJSON=$cardJSON'\n "description": "This token represents a stake in the outcome '"'"$EVENT_NAME"'"
cardJSON=$cardJSON' at Reality Cards, the planet'"'"'s first NFT-based prediction market",'
cardJSON=$cardJSON'\n "image": "'$CDN$IMAGES$SRC_NAME'/'${!card// /-}$suffix$IMAGE_FORMAT'",'
cardJSON=$cardJSON'\n "affiliation": "Reality Cards",'
cardJSON=$cardJSON'\n "cardType": "'$cardType'",'
cardJSON=$cardJSON'\n "attributes": [ '
cardJSON=$cardJSON'\n {'
cardJSON=$cardJSON'\n "display_type": "date",'
cardJSON=$cardJSON'\n "trait_type": "Event Start",'
cardJSON=$cardJSON'\n "value": '$START_TIME
cardJSON=$cardJSON'\n },'
cardJSON=$cardJSON'\n {'
cardJSON=$cardJSON'\n "display_type": "date",'
cardJSON=$cardJSON'\n "trait_type": "Event End",'
cardJSON=$cardJSON'\n "value": '$END_TIME
cardJSON=$cardJSON'\n }'
cardJSON=$cardJSON'\n ],'
cardJSON=$cardJSON'\n "external_url": "https://beta.realitycards.io/cards/'$SLUG'/'$i'"'
cardJSON=$cardJSON'\n}'

# save locally
echo -e "$cardJSON" > events/$SRC_NAME/token$i-$cardType.json
done

# save to IPFS
for ((i=0;i<$NUMBER_OF_CARDS;i++))
do

ipfscommand=$(curl -s -F file=@events/$SRC_NAME/token$i-$cardType.json "https://api.thegraph.com/ipfs/api/v0/add")
temp=${ipfscommand##*Hash}
ipfs_hash=${temp:3:46}

TOKEN_URIS=$TOKEN_URIS'"ipfs://'$ipfs_hash'"'
if [ $j -lt 4 ]
then
TOKEN_URIS=$TOKEN_URIS','
else
if [ $i -lt "$(($NUMBER_OF_CARDS-1))" ]
then
TOKEN_URIS=$TOKEN_URIS','
else
TOKEN_URIS=$TOKEN_URIS']'
fi
fi
done
done

### BUILD THE CONFIG JSON ###
Expand All @@ -87,8 +164,8 @@ temp=${ipfscommand##*Hash}
ipfs_hash=${temp:3:46}

# check for zero addresses
if [ "$ARTIST" == "" ];then
ARTIST=$ZERO_ADDRESS
if [ "$ARTIST_ADDRESS" == "" ];then
ARTIST_ADDRESS=$ZERO_ADDRESS
echo WARNING: ARTIST ADDRESS NOT SET
fi
if [ "$AFILLIATE" == "" ];then
Expand All @@ -113,27 +190,24 @@ if [ $i -lt "$(($NUMBER_OF_CARDS-1))" ];then
fi
done

#build oracle question and token URIs (both based on card numbers)
#build oracle question
ORACLE_QUESTION=$ORACLE_QUESTION'␟'
TOKEN_URIS='['
for ((i=0;i<$NUMBER_OF_CARDS;i++))
do
card='CARD'$i
ORACLE_QUESTION=$ORACLE_QUESTION'\"'${!card}'\"'
TOKEN_URIS=$TOKEN_URIS'"'$CDN$NFT$SRC_NAME'/token'$i'.json"'
if [ $i -lt "$(($NUMBER_OF_CARDS-1))" ]
then
ORACLE_QUESTION=$ORACLE_QUESTION','
TOKEN_URIS=$TOKEN_URIS','
else
ORACLE_QUESTION=$ORACLE_QUESTION'␟'
TOKEN_URIS=$TOKEN_URIS']'
fi
done
ORACLE_QUESTION=$ORACLE_QUESTION${CATEGORY}'␟en_US'

NOW=$(date)
EPOCH=$(TZ=UTC date "+%s")
START_DATE=$(TZ=UTC date --date "Jan 1, 1970 00:00:00 +0000 + ${START_TIME} seconds")
END_DATE=$(TZ=UTC date --date "Jan 1, 1970 00:00:00 +0000 + ${END_TIME} seconds")
if [ $END_TIME -lt $START_TIME ];then
echo WARNING: ENDING BEFORE STARTING
fi
Expand All @@ -142,14 +216,14 @@ if [ $START_TIME -lt $EPOCH ]; then
else
OFFSET=$((START_TIME - EPOCH))
if [ $OFFSET -lt 120 ];then
echo STARTING IN $OFFSET SECONDS
echo STARTING IN $OFFSET SECONDS on ${START_DATE} UTC
else
OFFSET=$(( OFFSET / 60 ))
if [ $OFFSET -lt 120 ];then
echo STARTING IN $OFFSET MINUTES
echo STARTING IN $OFFSET MINUTES on ${START_DATE} UTC
else
OFFSET=$(( OFFSET / 60 ))
echo STARTING IN $OFFSET HOURS
echo STARTING IN $OFFSET HOURS on ${START_DATE} UTC
fi
fi
fi
Expand All @@ -158,23 +232,24 @@ if [ $END_TIME -lt $EPOCH ]; then
else
OFFSET=$((END_TIME - EPOCH))
if [ $OFFSET -lt 120 ];then
echo ENDING IN $OFFSET SECONDS
echo ENDING IN $OFFSET SECONDS on ${END_DATE} UTC
else
OFFSET=$(( OFFSET / 60 ))
if [ $OFFSET -lt 120 ];then
echo ENDING IN $OFFSET MINUTES
echo ENDING IN $OFFSET MINUTES on ${END_DATE} UTC
else
OFFSET=$(( OFFSET / 60 ))
echo ENDING IN $OFFSET HOURS
echo ENDING IN $OFFSET HOURS on ${END_DATE} UTC
fi
fi
fi

CONFIG='{\n "start": "'${START_TIME}'",'
CONFIG=$CONFIG'\n "end": "'${END_TIME}'",'
CONFIG=$CONFIG'\n "slug": "'$SLUG'",'
CONFIG=$CONFIG'\n "oracle": "'${ORACLE_QUESTION}'",'
CONFIG=$CONFIG'\n "ipfs": "'${ipfs_hash}'",'
CONFIG=$CONFIG'\n "artist": "'${ARTIST}'",'
CONFIG=$CONFIG'\n "artist": "'${ARTIST_ADDRESS}'",'
CONFIG=$CONFIG'\n "sponsorship": "'${SPONSORSHIP}'",'
CONFIG=$CONFIG'\n "tokenURIs": '${TOKEN_URIS}','
CONFIG=$CONFIG'\n "affiliate": "'${AFILLIATE}'",'
Expand Down
Loading