Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Removes getters in favor of public member variables.#14

Open
MicahZoltu wants to merge 2 commits into
Giveth:masterfrom
MicahZoltu:patch-1
Open

Removes getters in favor of public member variables.#14
MicahZoltu wants to merge 2 commits into
Giveth:masterfrom
MicahZoltu:patch-1

Conversation

@MicahZoltu
Copy link
Copy Markdown

Also makes requestReturn external (it is good to be explicit about these things).

Since this contract was put together in a hurry, it is best to keep it as simple as possible, with no extra features beyond what is necessary to do its job. In this case, the getters were unnecessary complications that could be achieve (mostly) through a language feature. This won't do the defaulting for you, but the defaulting is just as easy to do in the calling contract/script as it is here.

Micah Zoltu added 2 commits July 23, 2017 10:00
Also makes `requestReturn` external (it is good to be explicit about these things).

Since this contract was put together in a hurry, it is best to keep it as simple as possible, with no extra features beyond what is necessary to do its job.  In this case, the getters were unnecessary complications that could be achieve (mostly) through a language feature.  This won't do the defaulting for you, but the defaulting is just as easy to do in the calling contract/script as it is here.
Having a return statement allows the caller to assert that the call was made and was successful.  Without a return statement, the caller can't tell the difference between the call running out of gas, the input address being wrong, the function signature being wrong (older versions of Solidity) and a successful call.  With a return statement the caller can do `require(chooseWhgReturnAddress.requestReturn(msg.sender));` to ensure safety.
@MicahZoltu
Copy link
Copy Markdown
Author

I also added a return value to requestReturn:

Having a return statement allows the caller to assert that the call was made and was successful. Without a return statement, the caller can't tell the difference between the call running out of gas, the input address being wrong, the function signature being wrong (older versions of Solidity) and a successful call. With a return statement the caller can do require(chooseWhgReturnAddress.requestReturn(msg.sender)); to ensure safety.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant