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

Enable certain dispatchable calls in smart contracts #1041

Merged
merged 41 commits into from
Aug 4, 2023

Conversation

sea212
Copy link
Member

@sea212 sea212 commented Jul 17, 2023

What does it do?

Removes the certain functions of AssetManager, PredictionMarkets and Swaps from the contracts call filters.

What important points should reviewers know?

The enabled dispatchable calls should be safe to be used within smart contracts as deleting a smart contract does not lead to unresolvable situations.
In addition to that, once smart contracts utilize dispatchable calls, those dispatchable calls must remain available to guarantee proper functioning of the smart contracts that are already deployed. As there is no value attached to contracts on Battery Station testnet, a changing interface is acceptable in exchange for the capability to test upcoming features early.
Lastly, the call_runtime function cannot be utilized in smart contracts although the runtime is prepared for this in this PR. Based on the advise from Parity's Ink! team, call_runtime will be available as an unstable feature from polkadot-v0.9.33 onwards and as a stable features from polkadot-v0.9.42.

Is there something left for follow-up PRs?

  • The feature unstable-interface will be replaced by a Config type for pallet-contracts

What alternative implementations were considered?

Are there relevant PRs or issues?

References

@sea212 sea212 added the s:review-needed The pull request requires reviews label Jul 17, 2023
@sea212 sea212 self-assigned this Jul 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2023

Codecov Report

Merging #1041 (f9d0fdf) into main (37e1a16) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main    #1041   +/-   ##
=======================================
  Coverage   92.94%   92.94%           
=======================================
  Files          92       92           
  Lines       21581    21581           
=======================================
  Hits        20058    20058           
  Misses       1523     1523           
Flag Coverage Δ
tests 92.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@sea212 sea212 requested review from Chralt98 and maltekliemann and removed request for Chralt98 July 17, 2023 09:31
runtime/battery-station/src/lib.rs Show resolved Hide resolved
runtime/battery-station/src/lib.rs Outdated Show resolved Hide resolved
runtime/battery-station/src/lib.rs Outdated Show resolved Hide resolved
@sea212 sea212 added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Jul 17, 2023
@sea212 sea212 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Jul 17, 2023
runtime/zeitgeist/src/lib.rs Show resolved Hide resolved
runtime/battery-station/src/lib.rs Show resolved Hide resolved
runtime/battery-station/src/lib.rs Outdated Show resolved Hide resolved
runtime/battery-station/src/lib.rs Outdated Show resolved Hide resolved
runtime/battery-station/src/lib.rs Outdated Show resolved Hide resolved
runtime/battery-station/src/lib.rs Outdated Show resolved Hide resolved
@Chralt98 Chralt98 added s:revision-needed The pull requests must be revised and removed s:review-needed The pull request requires reviews labels Jul 18, 2023
@FrankBevr
Copy link

FrankBevr commented Jul 19, 2023

Edit
Got pm, that helped. Thanks 🤗

Hola Harald 👋

@sea212

🥅 Goal

We wanna include one chain extension call.
Something simple, but works. would be fantastic.

❓ Problem

How do we include a chain extenstion in our contract?

ℹ️ Context

Toggle some context Pat, Tom and me are the guys who wanna test this chain extension.

We have a contract. The contract is simple. Its with purpose.
SwipePM - Hack

The contract looks:

classDiagram
    class football_match
    football_match : +i32 winner
    football_match : +AccountId participant_chelsea
    football_match : +AccountID participant_manchester
    football_match : +new()

    class FootballMatch
    <<interface>> FootballMatch
    FootballMatch : get_game()
    FootballMatch : set_winner()
    FootballMatch : set_participant_chelsea()
    FootballMatch : set_participant_manchester()
    
    FootballMatch <|-- football_match
Loading

Current Ressources
UseInkDocs
InkExample

Note
People assume if you give them similar code, they can make automatically the "transferleistung" to their code.
Yeah thats not the case 😅

❗ ❓ Solutions

  • Option A(Default): Give my best, see what happens
  • Option B: Someone takes an hour, sits next to me and we tinker together.
  • Option C: ?? ...

Cheers Frank ✌️

P.s. Malte gave me this link, so I just put this thing in here. I know its a bit out of context to this PR. But yeah, it relates, so thats fine🐵

Co-authored-by: Chralt <chralt.developer@gmail.com>
@sea212 sea212 added s:in-progress The pull requests is currently being worked on and removed s:revision-needed The pull requests must be revised labels Jul 20, 2023
sea212 and others added 2 commits July 20, 2023 11:20
Co-authored-by: Chralt <chralt.developer@gmail.com>
Co-authored-by: Chralt <chralt.developer@gmail.com>
@sea212 sea212 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Jul 20, 2023
@sea212 sea212 added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Jul 20, 2023
@sea212 sea212 added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Aug 3, 2023
@sea212 sea212 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Aug 3, 2023
@sea212 sea212 added this to the v0.3.11 milestone Aug 3, 2023
@Chralt98 Chralt98 self-requested a review August 3, 2023 14:01
maltekliemann
maltekliemann previously approved these changes Aug 3, 2023
Chralt98
Chralt98 previously approved these changes Aug 3, 2023
@mergify
Copy link
Contributor

mergify bot commented Aug 4, 2023

This pull request is now in conflicts. Could you fix it @sea212? 🙏

@mergify mergify bot added s:revision-needed The pull requests must be revised and removed s:review-needed The pull request requires reviews labels Aug 4, 2023
@sea212 sea212 added s:in-progress The pull requests is currently being worked on and removed s:revision-needed The pull requests must be revised labels Aug 4, 2023
@mergify mergify bot added s:revision-needed The pull requests must be revised and removed s:in-progress The pull requests is currently being worked on labels Aug 4, 2023
@sea212 sea212 dismissed stale reviews from Chralt98 and maltekliemann via db0b263 August 4, 2023 07:50
@sea212 sea212 added s:review-needed The pull request requires reviews and removed s:revision-needed The pull requests must be revised labels Aug 4, 2023
@sea212 sea212 added s:accepted This pull request is ready for merge and removed s:review-needed The pull request requires reviews labels Aug 4, 2023
@sea212 sea212 merged commit d67ae38 into main Aug 4, 2023
18 of 21 checks passed
@sea212 sea212 deleted the sea212-enable-sc-calls branch August 4, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:accepted This pull request is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants