We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Assume the following:
token.balance_of('stu') = 10
def transfer(from, to, amount): from_balance = get_balance_row(from) to_balance = get_balance_row(to) if from_balance >= amount: write_balance_row(to, to_balance + amount) write_balance_row(from, from_balance - amount)
rows affected in order: [ (READ, from), (READ, to), (WRITE, to), (WRITE, from) ]
Subtree block from MN-Africa:
transfer('raghu', 'stu', 1)
[ (READ, 'raghu'), (READ, 'stu'), (WRITE, 'stu'), (WRITE, 'raghu') ]
Subtree block from MN-Asia:
transfer('stu', 'davis', 1)
[ (READ, 'stu'), (READ, 'davis'), (WRITE, 'davis'), (WRITE, 'stu') ]
Subtree block from MN-America:
def funky_town(from, to_1, to_2, to_3): from_balance = get_balance_row(from) if from_balance < 10: transfer(from, to_1) elif from_balance > 10: transfer(from, to_2) else: # balance == 10 transfer(from, to_3)
funky_town('stuart', 'raghu', 'davis', 'falcon'
Delegate Africa gets subtrees in order:
transfer('raghu', 'stu', 10) transfer('stu', 'davis', 1) funky_town('stuart', 'raghu', 'davis', 'falcon'
transfer('raghu', 'stu', 10)
rows affected: [ (READ, 'raghu'), (READ, 'stu'), (WRITE, 'stu'), (WRITE, 'raghu') ], [ (READ, 'stu'), (READ, 'davis'), (WRITE, 'davis'), (WRITE, 'stu') ], [ # funky_town (READ, 'stu'), # balance == 19, transfer to falcon (READ, 'stu'), (READ, 'raghu'), (WRITE, 'raghu'), (WRITE, 'stu') ]
Delegate Asia gets subtrees in order:
transfer('stu', 'davis', 1) funky_town('stuart', 'raghu', 'davis', 'falcon' transfer('raghu', 'stu', 10)
rows affected: [ (READ, 'stu'), (READ, 'davis'), (WRITE, 'davis'), (WRITE, 'stu') ], [ # funky_town (READ, 'stu'), # balance == 9, transfer to davis (READ, 'stu'), (READ, 'davis'), (WRITE, 'davis'), (WRITE, 'stu') ], [ (READ, 'raghu'), (READ, 'stu'), (WRITE, 'stu'), (WRITE, 'raghu') ]
Delegate America gets subtrees in order:
funky_town('stuart', 'raghu', 'davis', 'falcon' transfer('raghu', 'stu', 1) transfer('stu', 'davis', 1)
rows affected: [ # funky_town (READ, 'stu'), # balance == 10, transfer to falcon (READ, 'stu'), (READ, 'falcon'), (WRITE, 'falcon'), (WRITE, 'stu') ], [ (READ, 'raghu'), (READ, 'stu'), (WRITE, 'stu'), (WRITE, 'raghu') ], [ (READ, 'stu'), (READ, 'davis'), (WRITE, 'davis'), (WRITE, 'stu') ]
Under this system, by describing smart contracts as READs and WRITEs, we can find the collisions and rerun them.
The text was updated successfully, but these errors were encountered:
Unless I'm not understanding, I think you mixed up in your funkytown results.
Sorry, something went wrong.
dhaba
wywfalcon
raghupc
lamdencalrissian
No branches or pull requests
Assume the following:
token.balance_of('stu') = 10
Subtree block from MN-Africa:
transfer('raghu', 'stu', 1)
Subtree block from MN-Asia:
transfer('stu', 'davis', 1)
Subtree block from MN-America:
funky_town('stuart', 'raghu', 'davis', 'falcon'
Delegate Africa gets subtrees in order:
transfer('raghu', 'stu', 10)
transfer('stu', 'davis', 1)
funky_town('stuart', 'raghu', 'davis', 'falcon'
Delegate Asia gets subtrees in order:
transfer('stu', 'davis', 1)
funky_town('stuart', 'raghu', 'davis', 'falcon'
transfer('raghu', 'stu', 10)
Delegate America gets subtrees in order:
funky_town('stuart', 'raghu', 'davis', 'falcon'
transfer('raghu', 'stu', 1)
transfer('stu', 'davis', 1)
Under this system, by describing smart contracts as READs and WRITEs, we can find the collisions and rerun them.
The text was updated successfully, but these errors were encountered: